//
        // GET: /ProductsSearch/

        public ActionResult Index()
        {
            var warehouseProducts = db.WarehouseProducts.ToList();
            var model             = new SearchProductsModels();

            model.WarehouseProducts = warehouseProducts;
            return(View(model));
        }
        public ActionResult Index(SearchProductsModels model)
        {
            var search = model.SearchText;

            if (string.IsNullOrEmpty(search))
            {
                model.WarehouseProducts = db.WarehouseProducts.ToList();
            }
            else
            {
                // fill restaurants in model
                model.WarehouseProducts = db.WarehouseProducts.Where(x => x.Products.name.Contains(search)).ToList();
            }

            // return model to the view
            return(View(model));
        }