Esempio n. 1
0
        public async Task <IActionResult> OnGet()
        {
            IEnumerable <ProductViewModel> allProducts = _productsService.GetAll();

            _sessionHelper.AddRenewItem("AllProducts", allProducts);;
            Products = allProducts.Select(product =>
                                          new SelectListItem
            {
                Value = product.Id.ToString(),
                Text  = product.Name
            }).ToList();

            return(Page());
        }