コード例 #1
0
        internal MenuPizzasViewModel ShowAllPizzas()
        {
            MenuPizzasViewModel viewModel = new MenuPizzasViewModel()
            {
                PizzaSuggestions = this.context.Pizzas.ToList()
            };

            return(viewModel);
        }
コード例 #2
0
        public IActionResult <MenuPizzasViewModel> Index(HttpSession currentSession, HttpResponse response)
        {
            if (!this.signInManger.IsAuthenticated(currentSession))
            {
                this.Redirect(response, "/home/index");
                return(null);
            }

            MenuPizzasViewModel viewModel = this.pizzasService.ShowAllPizzas();

            return(this.View(viewModel));
        }