Skip to content
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

Add .NET 4.5 specific project to support Task Based Async calls #49

Closed
wants to merge 5 commits into from

Conversation

bkaid
Copy link

@bkaid bkaid commented Sep 9, 2012

Added a QueryAsync method using .NET 4.5 style task based async call to ExecuteReaderAsync. Updated .nuspec file to include a .NET 4.5 library. Currently SQL server specific because SqlCommand defines ExecuteReaderAsync (not IDbCommand).

…se calls.

Requires SQL Server because ExecuteReaderAsync is defined on SqlCommand and not IDbCommand.
@mgravell
Copy link
Member

Actually, this is defined on the DbCommand: http://msdn.microsoft.com/en-us/library/hh223695.aspx - if possible, the least-specific version is preferable; however, I think this is more complex than first appears. In particular, I've got consideration towards things that decorate the command pattern (mini-profiler etc). We might need to invest a bit of time thinking about how we do this correctly in the more general context. I imagine a task with continuation would do it.

I think jumping on the sql-server one would be a bit of a mistake, long-term. Might be better to hold on this for now, pending more investigation.

I am perfectly open to a new 4.5-specific build; that doesn't bother me.

@bkaid
Copy link
Author

bkaid commented Sep 11, 2012

Thanks Marc - didn't catch that it was available on DbCommand. I updated my fork to use DbCommand instead of SqlCommand.

This attempt was as good as I could do. You and Sam are the experts here so I'll let you guys figure out the best approach. But it would be great if Dapper had built-in support for async querying.

@brannon
Copy link
Contributor

brannon commented Feb 2, 2013

+1 for Async support.

@antonheryanto
Copy link

👍 Async support too

@mgravell
Copy link
Member

I've merged this; thanks! Note: was a manual merge (conflicts etc), but seems to work. My preference would be to drag this into the core dll for 4.5, rather than a second nuget package - any thoughts on that? Have a look at the merged base and let me know.

@mgravell mgravell closed this May 23, 2013
@bkaid
Copy link
Author

bkaid commented May 23, 2013

Thanks Marc. I agree it would be great to have in the core nuget package and once its available I'll update the notes on my dapper-async nuget to indicate that the package is deprecated since the functionality has been moved to core dapper package.

oceangu2010 pushed a commit to oceangu2010/drapper that referenced this pull request Dec 26, 2013
thomasray711 added a commit to thomasray711/DapperLib-Dapper that referenced this pull request Apr 22, 2022
phoenixdev9 added a commit to phoenixdev9/Dapper that referenced this pull request Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants