public async Task OnGet() { var config = await _configRepository.GetAsync(); MapFromSiteConfiguration(config); MenuItems = await _configRepository.GetAllMenuItemsAsync(); FaviconExists = await _imagesRepository.FaviconExists(); }
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); }
public BlogModel(IArticlesService articlesService, ISiteConfigurationRepository configRepository) { _articlesService = articlesService; _pageSize = configRepository.GetAsync().Result.BlogPostsPageSize; }