A component of ASP.NET for creating RESTful web services that support HTTP-based communication between clients and servers.
I think that you can also do this:
public async Task<string> GetDocs()
{
return await Task.Run(() => JsonConvert.SerializeObject(CreateDocumentQuery().ToList()));
}
(By the way, if you consider the new System.Text.Json.JsonSerializer class, available in modern .NET, you will find a series of async functions, such as SerializeAsync).