Пример #1
0
 public IEnumerable<Product> ReadAll(Search search)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
              client.GetAsync("http://localhost:54980/api/products" + search.ToString()).Result;
         return response.Content.ReadAsAsync<IEnumerable<Product>>().Result;
     }
 }
Пример #2
0
        public ActionResult Index()
        {
            Search search = new Search();

            ProductViewModel viewModel = new ProductViewModel()
            {
                ProductList = facade.GetProductGateway().ReadAll(search),
                CategoryList = facade.GetCategoryGateway().ReadAll(),
                SubCategoryList = facade.GetCategoryGateway().ReadAllSubCategories(),
                ChildCategoryList = facade.GetCategoryGateway().ReadAllChildCategories()
            };

            return View(viewModel);
        }