public void CreateNewCategory(string categoryTitle) { Category newCategory = new Category { CategoryId = db.Categories.Count() + 1, Title = categoryTitle, }; db.Categories.Add(newCategory); db.SaveChanges(); }
public ActionResult CategoryDelete(Category category) { var categoryService = new CategoryLogic(); categoryService.DeleteCategory(category.CategoryId); return RedirectToAction("Categories"); }