public IActionResult Filter(int clientId, string searchTerm) { if (String.IsNullOrWhiteSpace(searchTerm)) { return(RedirectToAction("Index")); } clientId = 2; var viewModel = new WalletListVM(); var result = _service.GetListBySearchTerm(clientId, searchTerm); viewModel.SearchTerm = searchTerm; if (result.Result == GetResultEnum.Success) { //ModelMappings.Configure(); viewModel.Wallets = Mapper.Map <List <WalletInfoVM> >(result.List); return(View("Filter", viewModel)); } else { return(RedirectToAction("Error", "Home", new { Area = "Global" })); } }
// GET: /<controller>/ public IActionResult Index() { var viewModel = new WalletListVM(); var result = _service.GetList(1, ""); //ModelMappings.Configure(); if (result.Result == GetResultEnum.Success) { var vmList = Mapper.Map <List <WalletInfoVM> >(result.List); viewModel.Wallets = vmList; return(View(viewModel)); } else { return(RedirectToAction("Error", "Home", new { Area = "Global" })); } }