public ActionResult Edit(Topic topic) { if (ModelState.IsValid) { _db.Entry(topic).State = System.Data.EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); } return(View(topic)); }
// public ActionResult EditBlog(Blog blogs) { if (ModelState.IsValid == false) { return(View(blogs)); } using (var BlogDb = new BlogDb()) { BlogDb.Entry(blogs).State = EntityState.Modified; BlogDb.SaveChanges(); } return(RedirectToAction("Index")); }