11

I've just been reading up on the upcoming changes to c# and VB.Net using the new ASYNC and AWAIT keywords for asynchronous coding. Has anyone heard anything about whether or not this is going to be usable for async db calls via EF?

Thanks

1 Answer 1

7

We are evaluating the possibility of adding async capabilities to EF in the future, using the new Task-based pattern. It is too early to say whether and when this will happen but any information about the scenarios in which you expect to be able to take advantage of this feature will be greatly appreciated.

UPDATE: Async support has been added in EF6.

Sign up to request clarification or add additional context in comments.

8 Comments

Thanks divega-its good to hear this from the source. Our async needs are pretty basic, we simply want better UI responsiveness. We are developing a large (for us) case management system for the Dept of Justice in my province (in Canada). The system is built with WPF/MVVM/EF/SQL Server. A number of our UI's contain summaries of information pulled from numerous tables in the db (as well as other systems) and we'd like the ability to load those 'sections' of data while the user continues to work.Right now we just throw up the standard 'please wait' while the data is being retrieved.Thanks.
Just a follow up question: using the current CTP version of Task-based async can we create async functions that leverage LINQ-to-Entities in order to interact with the db? Thanks again.
Sorry it took so long to answer: to your follow up question: No. The CTP only includes Task-based async extension methods for compoenents that currently support async using previous async patterns. Since EF doesn't currently support async operation with any pattern, Task-based async support cannot be added without changes to the product.
Regarding the original comment, thanks a lot for giving us context on how you plan to use Task-based async support. One thing that comes to mind is that you can achieve a similar benefits by executing your data access layer in a background thread. Have you considered doing this?
@divega Do you have any update on this scenario? I want to be able to run async so I can lower the number of threads used on the webserver. asp.net mvc + async controllers would be used and EF should be able to support this.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.