public FullIngredientVM GetFullIngredientVM(int pageId, string category, int ingredientsPerPage) { List <IngredientWithCategoriesDTO> loadedIngredients = ingredientProcessor.GetAllInCategory((pageId - 1) * ingredientsPerPage, ingredientsPerPage, category); List <CategoryVM> Categories = categoryProcessor.GetAll().DTOToViewModelList(MapCategory); int ingredientCount = ingredientProcessor.Count(category); return(new FullIngredientVM() { Ingredients = loadedIngredients, PaginationInfo = new PaginationInfo() { Current = pageId, ItemsPerPage = ingredientsPerPage, ItemsCount = ingredientCount }, Categories = Categories, SelectedCategoryName = category }); }
public ActionResult Index() { List <CategoryVM> model = categoryProcessor.GetAll().DTOToViewModelList(MapCategory); return(View(model)); }