Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic is not playing nice with EF+ #418

Closed
hdusten opened this issue Sep 2, 2020 · 2 comments
Closed

Dynamic is not playing nice with EF+ #418

hdusten opened this issue Sep 2, 2020 · 2 comments
Assignees

Comments

@hdusten
Copy link

hdusten commented Sep 2, 2020

Good day,

I happened upon an obscure error today. I currently cannot use Dynamic and EF+ side by side using EF Core 3.1.

EDIT: Currently utilizing the latest versions of both libraries from nuget.

I get the following error:

"Oops! Select projection are not supported in EF+ Query IncludeFilter For more information, contact us: [email protected]"

The interesting element here is that I'm not explicitly using the IncludeFilter method from EF+

Here is a short version of what will cause the issue to occur inside my repository:

//expression where filter is Expression<Func<T, bool>> utilizing base EF Core framework ("ex. (x => x,Id == Id))
query = query.Where(filter);

//string expression where include is runtime value utilizes EF+ (ex. "Project.Image")
query = query.IncludeOptimizedByPath(include);

//string expression where orderby is runtime value utilizes Linq.Dynamic (ex. "Created desc")
query = query.OrderBy(orderby);

These calls happen in linear succession.

Is there anything I can try to get around this and or is there a fix that can be built for this. I wanted to reach out before attempting to circumvent or workaround this issue.

Thank you.

@hdusten
Copy link
Author

hdusten commented Sep 2, 2020

We may be able to close this issue out. I've uncovered that reordering the execution of the API calls seems to alleviate the collision between libraries.

You must utilize the Dynamic library prior to Utilizing the EF+ library of EF+ gets confused about what's going on.

This whole issue may be able to be copied over to the EF+ library.

@JonathanMagnan JonathanMagnan self-assigned this Sep 2, 2020
@JonathanMagnan
Copy link
Member

Hello @hdusten ,

Thank you for reporting,

In this case, we will probably close it as we are not sure how we can really fix it (as you noticed, both libraries don't always work well together).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants