-
Notifications
You must be signed in to change notification settings - Fork 934
AsQueryable() on collection throws if applied after Where statement #2471
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It fails in both 5.2 and 5.3. The query seems failed with IEnumerable.AsQueryable:
As you can see, even the criteria is a redundant one, it fails, but if I remove the AsQueryable part, it does not throw the exception. |
It should work if you apply Yeah if such query works in 4.x it looks like a bug. Can be reproduced adding the following test to [Test(Description = "GH-2471")]
public void TimeSheetsWithStringContainsSubQueryWithAsQueryableAfterWhere()
{
var query = (from timesheet in db.Timesheets
where timesheet.Entries.Where(e => e.Comments != null).AsQueryable().Any(e => e.Comments.Contains("testing"))
select timesheet).ToList();
Assert.That(query.Count, Is.EqualTo(2));
} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
If this is a regression of 5.0, shouldn't we backport its fix down to 5.0.x? |
Yes, we should. But do we want to do it? |
Uh oh!
There was an error while loading. Please reload this page.
A query (IQueryable) worked in version 4.0.4 but has exception in 5.2.2:
Can be reproduced by adding the following test to
WhereSubqueryTests
The text was updated successfully, but these errors were encountered: