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