public ActionResult EditCategory(ProjectsViewModel projectsModel) { var categoryToUpdate = projectsModel.UpdatedCategory; var existingCategory = _Context.SREDCategories.Where(category => category.SREDCategoryID == categoryToUpdate.SREDCategoryID).SingleOrDefault(); existingCategory.CategoryName = categoryToUpdate.CategoryName; _Context.Entry(existingCategory).State = System.Data.Entity.EntityState.Modified; _Context.SaveChanges(); return(RedirectToAction("Index", new { projectName = projectsModel.SelectedProject.ProjectName, toDate = projectsModel.ToDateString, fromDate = projectsModel.FromDateString })); }
public void Save() { _context.SaveChanges(); }