Пример #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);
 }
Пример #4
0
 public IResult Add(Category category)
 {
     _categoryDao.Add(category);
     return new SuccessResult(true, ResultMessages.CategoryAdded);
 }