// customers at one store location public ActionResult Index(string firstName, string lastName) { string storeLoc = TempData.Peek("adminLoc").ToString(); var customers = _storeRepo.GetAllCustomersAtOneStore(storeLoc); var viewCustomer = ViewModelMapper.MapCustomersWithoutEmail(customers); if (!String.IsNullOrEmpty(firstName) && !String.IsNullOrEmpty(lastName)) { // list, not mapped var searchedCustomers = _storeRepo.GetAllCustomersAtOneStoreByName(storeLoc, firstName, lastName); viewCustomer = ViewModelMapper.MapCustomersWithoutEmail(searchedCustomers); } return(View(viewCustomer)); }