public ActionResult Edit(Site site) { if (ModelState.IsValid) { db.Entry(site).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(site); }
public ActionResult Edit(Site site) { if (ModelState.IsValid) { siteRepository.UpdateSite(site); siteRepository.Save(); return RedirectToAction("Index"); } return View(site); }
public ActionResult Create(Site site) { if (ModelState.IsValid) { db.Sites.Add(site); db.SaveChanges(); return RedirectToAction("Index"); } return View(site); }
public void UpdateSite(Site Site) { context.Entry(Site).State = EntityState.Modified; }
public void InsertSite(Site Site) { context.Sites.Add(Site); }