Example #1
0
        public ActionResult ShowChildCategories(int categoryId)
        {
            IEnumerable <Category>       childCategories = _categoryProvider.GetChildCategoriesById(categoryId);
            ShowChildCategoriesViewModel model           = ParseShowChildCategoriesViewModel(childCategories, categoryId);

            return(PartialView("_ShowChildCategories", model));
        }
Example #2
0
        private ShowChildCategoriesViewModel ParseShowChildCategoriesViewModel(IEnumerable <Category> categories, int categoryId)
        {
            ShowChildCategoriesViewModel returnedModel = new ShowChildCategoriesViewModel();

            returnedModel.ChildCategories = categories;
            returnedModel.CurrentCategory = _categoryProvider.GetCategoryById(categoryId);
            return(returnedModel);
        }