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

Closed
wants to merge 5 commits into
from

Projects

None yet

4 participants

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).

@bkaid bkaid Added .NET 4.5 style QueryAsync method to support asynchronous databa…
…se calls.

Requires SQL Server because ExecuteReaderAsync is defined on SqlCommand and not IDbCommand.
3fccaa6
Contributor

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 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.

Contributor
brannon commented Feb 2, 2013

+1 for Async support.

👍 Async support too

Contributor

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 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 oceangu2010 pushed a commit to oceangu2010/drapper that referenced this pull request Dec 26, 2013
@mgravell mgravell Async; manual merge of StackExchange/Dapper#49
- huge thanks to bkaid
37329c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment