// GET: Product public ActionResult Index(string searchString) { ProductLModel viewModel = new ProductLModel(); ProductViewModel productViewer = new ProductViewModel(this, viewModel); viewModel = productViewer.Build(); var ProductRes = viewModel.ProductList; if (!String.IsNullOrEmpty(searchString)) { viewModel.ProductList = ProductRes.Where(str => str.Name5.IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0); } return(View(viewModel)); }