public ActionResult Edit([Bind(Include = "NoteNo,Subject,T_Name,Contents,Title,Date")] Homework homework) { if (ModelState.IsValid) { db.Entry(homework).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homework)); }
public void UpdateMaster(Master update) { try { //var number = _context.Master.Find(id); //number.Date = DateTime.UtcNow; //number.Value1 = update.Value1; //number.Value2 = update.Value2; //_context.Master.Update(number); _context.Entry(update).State = EntityState.Modified; _context.SaveChanges(); } catch (Exception e) { throw new Exception(); } }