-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Unbuffered QueryAsync implementation #76
Comments
Thank you for reporting, I will try to look at it over the weekend to update our documentation correctly. |
Hello @walidmabdelal , Thank you again for letting us know. We added a note in the async section here and a new page about Dapper QueryUnbufferedAsync I believe this page is good enough until the next major version of Dapper is released. Best Regards, Jon |
Hi @JonathanMagnan , Happy to help. Love the note at the end of the async page! The QueryUnbufferedAsync is good to go; however here are some ideas for the future: 1- Coupling the QueryUnbufferedAsync with the robust IAsyncEnumerable type for maximum control and support for cancellation, a method signature could return IAsyncEnumerable 2- Cancellation: Enabling cancellation could look something like:
Although in ASP.NET there is no SynchronizationContext so ConfigureAwait here is mroe of a convention and for behavior consistency. Also, note the EnumeratorCancellation attribute annotation from the C# 8~12 features to tell the compiler to use the token passed to the method. Thanks for the updates and your efforts Jon. Gratefully, |
Dapper now has the QueryUnbufferedAsync method to take care of this. The use of the QueryAsync with the unbuffered flag set to false as shown in the Buffered\Unbuffered page won't work as the SQL Mapper doesn't expose such a method, at least as of latest releases.
The text was updated successfully, but these errors were encountered: