public ActionResult DeleteConfirmed(int id) { Type_blog type_blog = db.Type_blog.Find(id); db.Type_blog.Remove(type_blog); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name")] Type_blog type_blog) { if (ModelState.IsValid) { db.Entry(type_blog).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(type_blog)); }
public ActionResult Create([Bind(Include = "id,name")] Type_blog type_blog) { if (ModelState.IsValid) { db.Type_blog.Add(type_blog); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(type_blog)); }
// GET: Back/Type_blog/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Type_blog type_blog = db.Type_blog.Find(id); if (type_blog == null) { return(HttpNotFound()); } return(View(type_blog)); }