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