EntityFramework-Plus icon indicating copy to clipboard operation
EntityFramework-Plus copied to clipboard

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]'.

Open arpitaw opened this issue 5 years ago • 3 comments

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:

arpitaw avatar Oct 26 '20 17:10 arpitaw

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 ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation Eval.Execute("x + y", new {x = 1, y = 2}); // return 3 C# Eval FunctionSQL Eval Function

JonathanMagnan avatar Oct 26 '20 17:10 JonathanMagnan

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

arpitaw avatar Oct 26 '20 18:10 arpitaw

I am experiencing the same issue. This happens on Microsoft.EntityFrameworkCore 3 and 5 Is there any way around this or a fix?

GregNikitas avatar Mar 05 '22 19:03 GregNikitas

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?

suhaibans avatar Jun 06 '23 19:06 suhaibans

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

JonathanMagnan avatar Jun 11 '23 21:06 JonathanMagnan