Пример #1
0
        public ActionResult ShowProductSearchResults(string searchText)
        {
            NorthwindDb            db = new NorthwindDb(_connectionString);
            ProductSearchViewModel vm = new ProductSearchViewModel
            {
                Products   = db.SearchProducts(searchText),
                SearchText = searchText
            };

            return(View(vm));
        }
Пример #2
0
        public IActionResult SearchResults(int minStock, int maxStock)
        {
            NorthwindDb             db       = new NorthwindDb(@"Data Source=.\sqlexpress;Initial Catalog=Northwnd;Integrated Security=True;");
            List <Product>          products = db.SearchProducts(minStock, maxStock);
            SearchProductsViewModel vm       = new SearchProductsViewModel
            {
                Products = products,
                MinStock = minStock,
                MaxStock = maxStock
            };

            return(View(vm));
        }