Пример #1
0
        public ActionResult ArticleCategoriesSection()
        {
            var categories          = _articlesRepo.GetArticleCategories();
            var articleCategoriesVm = new List <ArticleCategoriesViewModel>();

            foreach (var item in categories)
            {
                var vm = new ArticleCategoriesViewModel();
                vm.Id           = item.Id;
                vm.Title        = item.Title;
                vm.ArticleCount = _articlesRepo.GetArticlesCount(item.Id);
                articleCategoriesVm.Add(vm);
            }
            return(PartialView(articleCategoriesVm));
        }
Пример #2
0
 // GET: Admin/Articles/Create
 public ActionResult Create()
 {
     ViewBag.ArticleCategoryId = new SelectList(_repo.GetArticleCategories(), "Id", "Title");
     return(View());
 }