public ActionResult CategoryDelete(int id) { category.Remove(id); var Category = category.Get_All().Select ( item => new CategoriesItemViewModel { Id = item.Id, Discription = item.Discription, Name = item.Name } ).ToList(); return(PartialView("Category", Category)); }
public ActionResult Delete(CategoriesItemViewModel item) { _context.Remove(item.Id); return(RedirectToAction("Index")); }