Hi,
I'm a bit confused about async. I have the following code that calls Azure DocumentDB. Most of the code is from the code sample Microsoft team published but I modified it a bit.
First, my action method in my MVC app. Do I have to make my action method async because I'm calling an async method?
public async Task<ActionResult> TestMyDocumentDb()
{
dynamic peopleList = await PeopleMgmt.DocumentDbFunctions.GetPeopleList();
List<Person> people = peopleList;
return View(people);
}
Now, the code where I make a call to DocumentDB:
// DocumentDB settings
private static readonly string endpointUrl = ConfigurationManager.AppSettings["EndPointUrl"];
private static readonly string authorizationKey = ConfigurationManager.AppSettings["AuthorizationKey"];
private static DocumentClient client;
public ...
Go to the complete details ...