-
Notifications
You must be signed in to change notification settings - Fork 934
Recognition error occurs using System.Linq.Queryable.Contains #2544
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
Comments
Does it work with 5.2? |
It does not work with 5.2.7. From the looks of it, this regression may have happened between major versions 4.x and 5.x. |
As a workaround you can use session.Query<Video>().Any(x => x == subtitle?.Video) |
This is something I've also identified, which worked in 4.x but fails with 5.0 or later. We are able to work around it as suggested by using .Any, but it would be good if a fix can be found. |
We are implementing a fix for 5.3.x, but have not yet decided whether to back-port it down to 5.0.x or not, see here. |
Fixed by #2674 |
Background
While chasing down another NHibernate-related error, I came across this. This was working in 4.x (verified with 4.0.4.4000).
Description
Typically, when handling
IQueryable<T>
instances, the expectation is that invokingContains(T)
will yield a database query that is equivalent of an efficient EXISTS SQL statement. As of 5.3.3, however, the following exception is generated by the sample source code below:Sample Source Code
Database Schema & Sample Data
The text was updated successfully, but these errors were encountered: