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 } }
public static string ToHtml(this object blockContent, SanityHtmlBuilder builder) { return(builder.BuildAsync(blockContent).Result); }
public static Task <string> ToHtmlAsync(this object blockContent, SanityHtmlBuilder builder) { return(builder.BuildAsync(blockContent)); }