I am working with Code First EntityFramework (version="6.1.0"
) and EntityFramework.Extended (version="6.1.0.96, the latest build at the moment from here.
The DbContext
exposes the DbSets
which are accessed like:
var set = ctx.Set<MyEntity>();
Today I decided to try Future Queries of the EntityFramework.Extended library, and ended pretty much soon, without an idea of how to proceed.
Here is the sample code:
using (var ctx = new MyDbContext())
{
var u = ctx.Set<User>().Future();
var c = ctx.Set<Country>().Future();
var users = u.ToList();
}
Regarding the Future()
documentation I should get only one query to the DB which is what the Future()
method provides. The query should be launched at u.ToList();
but what happens is that I get an error like this:
JIT Compiler encountered an internal limitation.
A stack trace dive tells me this:
at EntityFramework.Future.FutureQueryBase 1.GetResult()
at EntityFramework.Future.FutureQuery 1.GetEnumerator()
at System.Collections.Generic.List 1..ctor(IEnumerable 1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable 1 source)
at App.Program.Main(String[] args) in c:\Users\...\App\Program.cs:line 25
I really don't know what I'm missing out. I've checked that my ConnectionString
has MultipleResultSets
set to TRUE
.
I've tested this with earlier build releases of EF.Exteneded
but the same error occured.
Any idea would greatly help.
User
andCountry
classes as well? – Quadrille