Simple consecutive calls

suggest change
public async Task<JobResult> GetDataFromWebAsync()
{
  var nextJob = await _database.GetNextJobAsync();
  var response = await _httpClient.GetAsync(nextJob.Uri);
  var pageContents = await response.Content.ReadAsStringAsync();
  return await _database.SaveJobResultAsync(pageContents);
}

The main thing to note here is that while every await-ed method is called asynchronously - and for the time of that call the control is yielded back to the system - the flow inside the method is linear and does not require any special treatment due to asynchrony. If any of the methods called fail, the exception will be processed “as expected”, which in this case means that the method execution will be aborted and the exception will be going up the stack.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Async Await:
* Simple consecutive calls

Table Of Contents
17 Regex
19 Arrays
21 Enum
22 Tuples
24 GUID
27 Looping
36 Casting
46 Methods
88 Events
92 Structs
104 Indexer
106 Stream
107 Timers
109 Threading
111 Async Await
127 Caching
135 Pointers
147 C# Script