public List <Entity.Customer> Search(string searchText) { if (!string.IsNullOrEmpty(searchText)) { return(_context.Set <Entity.Customer>().Where(BuildLikeExpression(searchText)).ToList()); } else { return(_context.Customers.ToList()); } }
// GET: Customers/DeleteALl/5 public ActionResult DeleteAll(string confirmButton) { using (var context = new CustomerDBContext()) { var itemsToDelete = context.Set <Customer>(); context.Customers.RemoveRange(itemsToDelete); context.SaveChanges(); } return(RedirectToAction("Index")); }