Example #1
0
        public ActionResult Create(House community)
        {
            if (ModelState.IsValid)
            {
                db.Houses.Add(community);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(community);
        }
Example #2
0
 public ActionResult Edit(House community)
 {
     if (ModelState.IsValid)
     {
         db.Entry(community).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(community);
 }