コード例 #1
0
        public async Task OnGet()
        {
            var config = await _configRepository.GetAsync();

            MapFromSiteConfiguration(config);

            MenuItems = await _configRepository.GetAllMenuItemsAsync();

            FaviconExists = await _imagesRepository.FaviconExists();
        }
コード例 #2
0
        public async Task OnGetAsync()
        {
            var page = await _pagesService.GetIndexAsync();

            if (page == null)
            {
                Title    = "404 Not Found";
                HtmlBody = "Unfortunately this page was not found.";
                return;
            }
            Id       = page.Id;
            Title    = page.Title;
            HtmlBody = page.HtmlBody;

            var latestBlogPostsCount = (await _configRepository.GetAsync()).LatestBlogPostsCount;

            LatestArticles = await _articlesService.GetLatestAsync(latestBlogPostsCount);

            PopularArticles = await _articlesService.GetMostPopularAsync(latestBlogPostsCount);
        }
コード例 #3
0
ファイル: Blog.cshtml.cs プロジェクト: anmalkov/simple-blog
 public BlogModel(IArticlesService articlesService, ISiteConfigurationRepository configRepository)
 {
     _articlesService = articlesService;
     _pageSize        = configRepository.GetAsync().Result.BlogPostsPageSize;
 }