public ActionResult SearchProduct(string search, string view) { List <StoreDomainModel> productDM = storeBusiness.SearchProduct(search); List <StoreViewModel> productVM = new List <StoreViewModel>(); AutoMapper.Mapper.Map(productDM, productVM); if (view == "grid") { return(PartialView("_Products", productVM)); } else { return(PartialView("_ProductsList", productVM)); } }