I want to use a micro-orm and decided to go with Dapper.
But can't seem to find any mentions of it supporting the new async/await syntax. Async queries are important for me.
Can someone provide a code example of an async query being made with Dapper using the await keyword ?
The async keyword turns a method into an async method, which allows you to use the await keyword in its body. When the await keyword is applied, it suspends the calling method and yields control back to its caller until the awaited task is complete. await can only be used inside an async method.
So far, we performed all synchronous operations, but Dapper also fully supports async versions of all of the primary methods.
The await operator suspends evaluation of the enclosing async method until the asynchronous operation represented by its operand completes. When the asynchronous operation completes, the await operator returns the result of the operation, if any.
Dapper when targeting .NET 4.5 has full support for TPL usage, via the methods ending in *Async - QueryAsync etc. Specifically, the .NET 4.5 build includes this extra set of methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With