public ActionResult Edit([Bind(Include = "CategoryID,Name")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "PostID,Title,Content,Image,Note,CategoryID")] Post post) { if (ModelState.IsValid) { db.Entry(post).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(post)); }