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