Esempio n. 1
0
        public IActionResult AllFoods()
        {
            var viewModel = new AllFoodsViewModel();
            var foods     = this.foodsService.GetAllFoods <FoodViewModel>();

            viewModel.Foods = foods;
            return(this.View(viewModel));
        }
Esempio n. 2
0
        public IActionResult All(int page = 1)
        {
            var allFoods  = this.foodService.All(page);
            var totalFood = this.foodService.Total();

            var model = new AllFoodsViewModel
            {
                Foods       = allFoods,
                Total       = totalFood,
                CurrentPage = page
            };

            return(this.View(model));
        }