public IActionResult AllFoods() { var viewModel = new AllFoodsViewModel(); var foods = this.foodsService.GetAllFoods <FoodViewModel>(); viewModel.Foods = foods; return(this.View(viewModel)); }
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)); }