Пример #1
0
        public static StandardPageViewModel Create(StandardPage currentPage, CategoryRepository categoryRepository)
        {
            var model = new StandardPageViewModel(currentPage);

            if (currentPage.Category.Any())
            {
                model.CategoryName = categoryRepository.Get(currentPage.Category.FirstOrDefault()).Description;
            }
            return(model);
        }
Пример #2
0
        public ActionResult Index(StandardPage currentPage)
        {
            var model = StandardPageViewModel.Create(currentPage, _categoryRepository);

            return(View(model));
        }