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)); } }
public bool Add(Category category) { return(_categoryDao.Add(category)); }
public void Add(Category category) { _categoryDao.Add(category); }
public IResult Add(Category category) { _categoryDao.Add(category); return new SuccessResult(true, ResultMessages.CategoryAdded); }