public async Task <AboutItem> GetAboutItem(CancellationToken cancellationToken, string entryId)
        {
            var entry = await _contentfulClient.GetAsync <Entry>(cancellationToken, entryId);

            return(new AboutItem
            {
                Body = _markdownParser.GetHtmlFromMarkdown(entry.GetString("body")),
                Title = entry.GetString("title")
            });
        }
Ejemplo n.º 2
0
        public async Task <Entry> GetArticleById(string articleId)
        {
            try
            {
                var article = await contentfulClient.GetAsync <Entry>(cancellationToken, articleId);

                return(article);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
        public async Task <BlogEntry> GetBlogEntryById(string id, CancellationToken cancellationToken)
        {
            var entry = await _contentfulClient.GetAsync <Entry>(cancellationToken, id);

            return(GetBlogEntryFromContentfulEntry(entry));
        }