Exemple #1
0
        public async Task OnGet()
        {
            var config = await _configRepository.GetAsync();

            MapFromSiteConfiguration(config);

            MenuItems = await _configRepository.GetAllMenuItemsAsync();

            FaviconExists = await _imagesRepository.FaviconExists();
        }
Exemple #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);
        }
Exemple #3
0
 public BlogModel(IArticlesService articlesService, ISiteConfigurationRepository configRepository)
 {
     _articlesService = articlesService;
     _pageSize        = configRepository.GetAsync().Result.BlogPostsPageSize;
 }