3

Closed

UpForGrabs: Async testability improvements

description

Now that we have async support on EF, questions are starting to come up more often about the best way to implement common testability practices. A common request is to be able to use other IQueryables with the async extension methods defined on EF. These extension methods require that IQueryables also implement the interface IDbAsyncEnumerable<T> defined by EF to work.

How can we make this easier?

The first approach we are taking for EF6 is to write a "fake query" implementation of IQueryable<T> and IDbAsyncEnumerable<T> and make it available as an example in our documentation. The only problem with this approach is that it takes more work to copy an paste (and possibly modify) this code to do a relatively simple and reasonable task.

Another alternative would be to have a built in implementation of this "fake queries" in the product.

Yet another alternative would be to make it unnecessary to implement IDbAsyncEnumerable<T> in fakes, e.g. by making the default implementation of the async extension methods fall back to synchronous evaluation when the interface is not available.
Closed Dec 12, 2016 at 10:39 PM by RoMiller
EF Team Triage: We are transitioning this project to GitHub (https://github.com/aspnet/EntityFramework6). As part of this transition we are bulk closing a large number of issues in order that our new issue tracker will accurately reflect the work that our team is planning to complete on the EF6.x code base.

Moving forwards, our team will be fixing bugs, implementing small improvements, and accepting community contributions to the EF6.x code base. Larger feature work and innovation will happen in the EF Core code base (https://github.com/aspnet/EntityFramework). Closing a feature request in the EF6.x project does not exclude us implementing the feature in EF Core. In fact, a number of popular feature requests for EF have already been implemented in EF Core (alternate keys, batching in SaveChanges, etc.).

This is a bulk message to indicate that this issue was closed and not ported to the new issue tracker. The reasons for not porting this particular issue to GitHub may include:
  • It was a bug report that does not contain sufficient information for us to be able to reproduce it
  • It was a question, but sufficient time has passed that it's not clear that taking the time to answer it would provide value to the person who asked it
  • It is a feature request that we are realistically not going to implement on the EF6.x code base
    Although this issue was not ported, you may still re-open it in the new issue tracker for our team to reconsider (https://github.com/aspnet/EntityFramework6/issues). We will no longer be monitoring this issue tracker for comments, so please do not reply here.

comments

dfowler wrote Jul 23, 2013 at 2:56 AM

This is hitting me in jabbr as I just switched to EF 6 and have changed a few areas to use ToListAsync. What would be to nice was if ToListAsync had a default implementation that was either sync or called Task.Run.

divega wrote Aug 14, 2013 at 9:20 AM

We previously discussed doing this in 6.1 so clearing up release field.