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