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