Async Entity Framework Queries

I’ve been writing a lot of Node.js recently, and I’ve really love how the asynchronous database access works, and thought to myself “I wonder if I can do that with Entity Framework?”

While I couldn’t find anywhere in EF the inherently support any form of async calls, I did find that you can with the underlying SqlConnection (assuming you’re using MSSQL.)

So with a little bit of Async CTP magic mixed in, I created an extension method to read the data asynchronously.

Unfortunately I couldn’t find an obvious way to open the connection or write data asynchronously, but I think this is good step.

Phil

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>