public void Update(M.Category model) { var item = _categoryRepo.GetById(model.ID); item.Name = model.Name; _categoryRepo.Update(item); UnitOfWork.SaveChanges(); }
public M.Category Create(M.Category model) { var category = new DB.Category() { Name = model.Name }; _categoryRepo.Create(category); UnitOfWork.SaveChanges(); model.ID = category.ID; return(model); }