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

No property or field 'DynamicFunctions' exists in type 'Log' #396

Closed
JamesRoche opened this issue Jul 3, 2020 · 6 comments
Closed

No property or field 'DynamicFunctions' exists in type 'Log' #396

JamesRoche opened this issue Jul 3, 2020 · 6 comments

Comments

@JamesRoche
Copy link

I keep getting this error thrown when trying to use DynamicFunctions.Like() in my queries. I can also see in the examples on the website that they are suffering from the same issues. Has this API been changed?

JS Fiddle from your site which also failed https://dotnetfiddle.net/dy4vkE

@StefH
Copy link
Collaborator

StefH commented Jul 3, 2020

Correct, I could not get this Fiddle working. (@JonathanMagnan : can you remove this one please)

@JamesRoche : See this example c# where it does work:
https://github.com/zzzprojects/System.Linq.Dynamic.Core/blob/master/src-console/ConsoleAppEF2.1.1/Program.cs#L130

@JamesRoche
Copy link
Author

You are a legend thank you :)

@JamesRoche
Copy link
Author

I have implemented as per the example you sent over, should this be translating into a LIKE SQL for entity core?

@StefH
Copy link
Collaborator

StefH commented Jul 3, 2020

I've the feeling that for EF Core, it's still evaluated client-side. Not 100% sure....

@JonathanMagnan
Copy link
Member

See the section about "LINQ queries are no longer evaluated on the client"

https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes

New behavior
Starting with 3.0, EF Core only allows expressions in the top-level projection (the last Select() call in the query) to be evaluated on the client. When expressions in any other part of the query can't be converted to either SQL or a parameter, an exception is thrown.

So anything in the "WHERE" part should not.

@artnova-david
Copy link

Hi,
I'm also having the same issue this simple query gives the error "No property or field 'DynamicFunctions' exists in type 'Customer'". I installed the necessary dll's but still not working. Am I missing something?
var config = ParsingConfig.DefaultEFCore21;
config.ResolveTypesBySimpleName = true;
return await _db.Customers.Where(config, "DynamicFunctions.Like(Name, \"%a%\")").ToListAsync();

Thanks for your response
Kind regards

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

4 participants