Creating an async method with tasks

In this recipe, we will be looking at the asynchronous programming capabilities found in the C# language. C# has language-level asynchronous capabilities, and therefore you don't have to rely on a third-party library. If you have I/O operations, such as reading data from a network or from a database, you can utilize asynchronous programming. You can also use asynchronous programming for CPU-bound, expensive calculations.

Get .NET Standard 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.