コード例 #1
0
        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")
            });
        }
コード例 #2
0
 private BlogEntry GetBlogEntryFromContentfulEntry(Entry entry)
 {
     return(new BlogEntry
     {
         Id = entry.SystemProperties.Id,
         Body = _markdownParser.GetHtmlFromMarkdown(entry.GetString("content")),
         PublishDateTime = entry.SystemProperties.CreatedDateTime,
         Title = entry.GetString("title")
     });
 }