C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,621 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
1) what ConfigureAwait function does ? and when to use it?
async Task<int> GetPageCountAsync()
{
//not shown is how to set up your connection and command
//nor disposing resources
//nor validating the scalar value
var pages = await command.ExecuteScalarAsync().ConfigureAwait(false);
return (int)pages;
}
Please guide me when i should pass false and when i should not pass false to ConfigureAwait function ?
2) async and await is IO bound job or CPU bound job ? how do i understand it?
Thanks
See the following blogs. It has to do with using the SynchronizationContext or not.
https://devblogs.microsoft.com/dotnet/configureawait-faq/
https://blog.stephencleary.com/2017/03/aspnetcore-synchronization-context.html
Parallel Computing - It's All About the SynchronizationContext