Field '_queryCompiler' defined on type 'Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider' is not a field on the target object which is of type 'System.Linq.EnumerableQuery`1[Context]'.
Description
Describe the issue or proposed feature.
Exception
If you are seeing an exception, include the full exceptions details (message and stack trace).
Exception message:
Stack trace:
Fiddle or Project
Create a Fiddle that reproduce the issue: https://dotnetfiddle.net/zB4SGA
Or provide a project/solution that we can run to reproduce the issue.
- Make sure the project compile
- Make sure to provide only the code that is required to reproduce the issue, not the whole project
- You can send private code here: [email protected]
Note: If you are not able to provide code we can run and that reproduce the issue, we will not be able to fix it either.
Further technical details
- EF version:
- EF Plus version:
- Database Provider:
Hello @arpitaw ,
Do you think you could provide a runnable project sample for this issue? It will help my developer to get started to investigate it faster and make sure nothing is missing.
Providing a project sample is now REQUIRED. It happened too many times that something was missing to investigate and/or answer an issue.
Try to create a new project with only the minimal code (having too many non-related codes doesn’t help either).
You can send it to [email protected] if you need to keep the source private
Best Regards,
Jon
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function
Hi @JonathanMagnan the project is working fine but I am trying to create the unit test on context.bulkinsert(obj) but getting an exception as below: Field '_queryCompiler' defined on type 'Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider' is not a field on the target object which is of type 'System.Linq.EnumerableQuery`1[PfsSparApi.EFCore.SPAR.Entities.Transaction]'.
Please suggest how to mock the data for this extension
I am experiencing the same issue. This happens on Microsoft.EntityFrameworkCore 3 and 5 Is there any way around this or a fix?
Hi @JonathanMagnan is there any update on this? are we able to mock the context for z.Entityframework.plus library for Future method? Is there any workaround on this one?
Hello @suhaibans ,
I don't think something will be done here. Changing our code to be able to support Mocking is almost impossible in many scenarios. We instead recommend using a local database for testing or a memory one.
I will close this issue as I don't think it will ever be done.
Best Regards,
Jon