public ActionResult Grid() { //-- Get the list of customers IEnumerable<ICustomer> customers = customersRepository.GetAll(); //-- Create a new view model to display CustomersViewModel customersViewModel = new CustomersViewModel(customers); //-- Show view return View(customersViewModel); }
public ActionResult Delete(int id) { //-- Delete the item customersRepository.Delete(id); //-- Create a new view model to display CustomersViewModel customersViewModel = new CustomersViewModel(customersRepository.GetAll()); return PartialView("PartialViews/_CustomerGrid", customersViewModel); }