Example #1
0
        public PartialViewResult Navbar(String category = null, String searchText = null)
        {
            List <Category> categories = articleRepository.GetAllCategories();
            List <Article>  articles   = articleRepository.GetAllArticles();

            MenuCategoriesListViewModel model = new MenuCategoriesListViewModel(category, searchText)
            {
                Categories = Mapper.Map <List <Category>, List <MenuCategoryModel> >(categories),
            };

            ArticleService.CalculateCategoriesCount(model.Categories, articles);

            return(PartialView("NavbarPartial", model));
        }
        public ViewResult NewArticle()
        {
            List <Category>         data  = articleRepository.GetAllCategories();
            CategoriesListViewModel model = new CategoriesListViewModel(null, null)
            {
                Categories = data,
            };

            return(View(model));
        }