public ActionResult Edit([Bind(Include = "CategoryID,CategoryName")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "ID,Messages,Timestamp")] Message message) { if (ModelState.IsValid) { db.Entry(message).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(message)); }
public ActionResult Edit([Bind(Include = "UserID,UserName,UserLastName,UserFirstName,UserCity")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "Id,MessageID")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MessageID = new SelectList(db.Messages, "ID", "Messages", user.MessageID); return(View(user)); }