public ActionResult Change(Note note) { if (note != null) { var _note = db.Notes.Where(i => i.Id == note.Id).FirstOrDefault(); _note.Body = note.Body; //db.Entry(note).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); db.Dispose(); return(RedirectToAction("Index")); } return(HttpNotFound()); }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
public void Terminate() { noteContext.Dispose(); scope.Dispose(); }
public void Dispose() { _dbContext.Dispose(); }
protected override void Dispose(bool disposing) { notesContext.Dispose(); base.Dispose(disposing); }