-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Throw a better exception for failed translations (i.e. client evaluation not supported) #16133
Comments
Duplicate of #14572 That being said, second query may not work because of client eval. |
@nixxcz Also, many thanks for trying preview 6. We really appreciate people trying the previews and filing issues on what they find. If you haven't seen it already, there is some good information in the preview announcement post about the changes that are happening to LINQ queries for EF Core 3.0. Preview 6 is the first release containing these changes, which means we are both expecting things to be broken, but at the same time very grateful for everyone who tries the release and generated feedback. |
Thanks @smitpatel and @ajcvickers for your replies. Does that mean that the more helpful exception from Preview 5 will be coming back in future versions? In case anyone is interested, I managed to work around the issue by using LinqKit.Microsoft.EntityFrameworkCore and its Func<Account, string, bool> predicate = (a, filter) => a.Email.Contains(filter); //passed from calling code
Expression<Func<Account, bool>> predicateExpression2 = a => predicate.Invoke(a, ".cz");
var query2 = context.Account.Where(predicateExpression2.Expand()); |
@nixxcz Not sure when the better exception is coming back, but that is the goal. |
SqlTranslator is also supposed to return null on VisitInvocation. |
Fixed SqlTranslator to not throw InvalidCastException. |
I'm passing a predicate to LINQ query as
Func<>
. The resulting expression cannot be, for some reason, translated to SQL. In Preview 5, I get a helpful exception. In Preview 6, I get no clue about what went wrong.#16101 may be related
I would appreciate suggestions on how to pass the predicate so that it can be translated.
Thank you!
Preview 5 behavior
Preview 6 behavior
Steps to reproduce
Further technical details
Packages
Operating system: Windows 10 Version 10.0.17763 Build 17763
IDE: VS 2019 16.2.0 Preview 2.0
The text was updated successfully, but these errors were encountered: