Best practices in asynchronous programming

Let's take a look at some good and bad practices to do with the asynchronous programming model in ASP.NET Core. First of all, the central concept to keep in mind is to avoid mixing between synchronous and asynchronous code. As mentioned previously, ASP.NET Core exposes both the sync and async versions of the majority of classes and interfaces. Therefore, before blocking an asynchronous stack with synchronous code, you should explore and check all the alternatives provided by the framework.

The following recommendations come from a high-level perspective of asynchronous programming in .NET. This book is focused on other aspects of the framework. If you want to get more details about how to work with asynchronous programming, I suggest you navigate to the following link: https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md. Moreover, if you want a more general overview of concurrency in .NET, I suggest you read the following book:  Concurrency in C# Cookbook by Stephen Cleary (https://stephencleary.com/book/).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.233.72