示例#1
0
 public RequestResponse Add([FromBody] Category category)
 {
     if (!ModelState.IsValid)
     {
         return(Utility.ErrorResponse(ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage).ToList()));
     }
     try
     {
         _categoryDao.Add(category);
         return(Utility.OkResponse("Kategori başarıyla eklendi."));
     }
     catch (Exception ex)
     {
         return(Utility.ErrorResponse(ex.Message));
     }
 }
示例#2
0
 public bool Add(Category category)
 {
     return(_categoryDao.Add(category));
 }
示例#3
0
 public void Add(Category category)
 {
     _categoryDao.Add(category);
 }
 public IResult Add(Category category)
 {
     _categoryDao.Add(category);
     return new SuccessResult(true, ResultMessages.CategoryAdded);
 }