コード例 #1
0
 public async Task ConvertTest()
 {
     // this test tries to serialize the Body-element of a Post-document from the Sanity demo-dataset.
     var sanity = new SanityDataContext(Options);
     var posts = await sanity.DocumentSet<Post>().ToListAsync();
     var htmlBuilder = new SanityHtmlBuilder(Options);
     foreach (var post in posts)
     {
         var html = htmlBuilder.BuildAsync(post.Body); // the serialized data
     }
 }
コード例 #2
0
 public static string ToHtml(this object blockContent, SanityHtmlBuilder builder)
 {
     return(builder.BuildAsync(blockContent).Result);
 }
コード例 #3
0
 public static Task <string> ToHtmlAsync(this object blockContent, SanityHtmlBuilder builder)
 {
     return(builder.BuildAsync(blockContent));
 }