public ActionResult Create(House community) { if (ModelState.IsValid) { db.Houses.Add(community); db.SaveChanges(); return RedirectToAction("Index"); } return View(community); }
public ActionResult Edit(House community) { if (ModelState.IsValid) { db.Entry(community).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(community); }