public ActionResult Edit(Comment comment) { if (ModelState.IsValid) { context.Entry(comment).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PossibleTasks = context.Tasks; return(View(comment)); }
public void InsertOrUpdate(Sprint sprint) { if (sprint.SprintID == default(long)) { // New entity context.Sprints.Add(sprint); } else { // Existing entity context.Entry(sprint).State = System.Data.Entity.EntityState.Modified; } }