c# - Entity Framework 6 Compiled LINQ Query -
c# - Entity Framework 6 Compiled LINQ Query -
i'm trying improve performance of web application caching query.
public static func<myentity, list<hashduplicates>, iqueryable<formresponse>> compiledduplicatedresponses = compiledquery.compile<myentity, list<hashduplicates>, iqueryable<formresponse>>( (db, hashes) => r in db.formresponse h in db.indexhashes d in hashes r.id == h.formresponseid && h.indexhashstring == d.hash select r);
the error receive @ compile time:
the type 'myentity' cannot used type parameter 'targ0' in generic type or method 'system.data.entity.core.objects.compiledquery.compile(system.linq.expressions.expression>)'. there no implicit reference conversion 'myentity' 'system.data.entity.core.objects.objectcontext'.
i'm using ef6
ok seems in ef5 , greater queries automatically compiled , there no need compile them. objectcontext not used anymore, , have dbcontext: compiled query no implicit reference conversion objectcontext
another interesting post on compiled query: http://blog.codinghorror.com/compiled-or-bust/
c# linq entity-framework caching compiled-query
Comments
Post a Comment