public ActionResult Edit(Service service) { if (ModelState.IsValid) { repo.Entry(service).State = EntityState.Modified; repo.SaveChanges(); TempData["Message"] = "Service Saved"; return RedirectToAction("Index"); } return View(service); }
public ActionResult Create(Service service) { if (ModelState.IsValid) { repo.Add(service); repo.SaveChanges(); TempData["Message"] = "Service Saved"; return RedirectToAction("Index"); } return View(service); }
public DbEntityEntry<Service> Entry(Service entity) { HttpContext.Current.Cache.Remove("Services"); // invalidate cache return db.Entry<Service>(entity); }
public Service Remove(Service entity) { HttpContext.Current.Cache.Remove("Services"); // invalidate cache Entry(entity).State = System.Data.EntityState.Deleted; return entity; }
public Service Add(Service entity) { HttpContext.Current.Cache.Remove("Services"); // invalidate cache return db.Services.Add(entity); }