public ActionResult Edit(Servicer servicer) { if (ModelState.IsValid) { repo.Entry(servicer).State = EntityState.Modified; repo.SaveChanges(); TempData["Message"] = "Employee Saved"; return RedirectToAction("Index"); } return View(servicer); }
public ActionResult Create(Servicer servicer) { if (ModelState.IsValid) { repo.Add(servicer); repo.SaveChanges(); TempData["Message"] = "Employee Saved"; return RedirectToAction("Index"); } return View(servicer); }
public Servicer Remove(Servicer entity) { HttpContext.Current.Cache.Remove("Servicers"); // invalidate cache Entry(entity).State = System.Data.EntityState.Deleted; return entity; }
public DbEntityEntry<Servicer> Entry(Servicer entity) { HttpContext.Current.Cache.Remove("Servicers"); // invalidate cache return db.Entry<Servicer>(entity); }
public Servicer Add(Servicer entity) { HttpContext.Current.Cache.Remove("Servicers"); // invalidate cache return db.Servicers.Add(entity); }
private void VerifyServicerFilter(ICurrentUser currentUser, Servicer servicer, bool expectedResult) { var filter = DataContextExtensions.GetServicerFilterForCurrentUser(currentUser); var actualResult = filter(servicer); Assert.AreEqual(expectedResult, actualResult); }