Exemplo n.º 1
0
        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
            });
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            List <CategoryVM> model = categoryProcessor.GetAll().DTOToViewModelList(MapCategory);

            return(View(model));
        }