Advertisement
Iv555

Untitled

Feb 25th, 2023
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public IActionResult All(int id = 1)
  2. {
  3. if (id <= 0)
  4. {
  5. return this.NotFound();
  6. }
  7.  
  8. const int ItemsPerPage = 12;
  9. var viewModel = new RecipesListViewModel
  10. {
  11. ItemsPerPage = ItemsPerPage,
  12. PageNumber = id,
  13. RecipesCount = this.recipesService.GetCount(),
  14. Recipes = this.recipesService.GetAll<RecipeInListViewModel>(id, ItemsPerPage),
  15. };
  16. return this.View(viewModel);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement