public TEntity Update(TEntity entity) { Context.Entry(entity).State = EntityState.Modified; Context.SaveChanges(); return(entity); }
public ActionResult Edit([Bind(Include = "UserID,UserVariance,Username,Password,Email,UserRole")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "MessageID,UserID,MessageText")] Message message) { if (ModelState.IsValid) { db.Entry(message).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserID = new SelectList(db.Users, "UserID", "UserVariance", message.UserID); return(View(message)); }