public async Task OnGetAsync() { MainLayout.ShoppingBasket = BasketHelper.GetBasket(HttpContext.Session); ViewData["MainLayout"] = MainLayout; Highlighted = await _ds.GetHighlightedProductsAsync(); OnSale = await _ds.GetProductsOnSaleAsync(); Latest = await _ds.GetLatestProductsAsync(); BestSellingProducts = _ds .GetBestSellingProducts() .Select(p => _ds .GetProductById(p.ProductId)); }
public async Task <IEnumerable <Product> > getAsync() { return(await _ds.GetProductsOnSaleAsync()); }