Asynchronous Programming (edit)
Asynchronous programming in C# | Microsoft Docs
When to Use (and Not to Use) Asynchronous Programming: 20 Pros Reveal the Best Use Cases – Stackify
Asynchronous Programming :: Eloquent JavaScript
.NET Framework
public string GetString() { ... var resp = response.Content .ReadAsStringAsync() .ConfigureAwait(false) .GetAwaiter() .GetResult(); return resp; }
.NET Core
public async Task ReadStringAsync() { ... return await response.Content.ReadAsStringAsync(); }
public async Task ReadStringAsync() { ... (no await called) return await Task.FromResult(string.Empty); }