I have:
async void getData()
{
Console.WriteLine("Start");
HttpClient api = new HttpClient();
await api.PostAsync("http://....", someContent).ContinueWith(
....
);
Console.WriteLine("End");
}
void main()
{
Task task = new Task(getData);
task.Start();
task.Wait();
Console.WriteLine("Returned");
}
I consistently get the following output:
Start
Returned
End
How is it possible that the end of the getData method is executed after control has returned to the calling method?