예제 #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);
 }