Description
We keep this issue to track specifying filters inline when you specify eager loading in a query. However there are many scenarios that can be satisfied with global query filters:
Please learn about global query filters
We are seeing that a large portion of the scenarios customers want this feature for can already be better addressed using global query filters. Please try to understand that feature before you add your vote to this issue.
We are keeping this issue open only to represent the ability to specify filters on Include on a per-query basis, which we understand can be convenient on some cases.
Original issue:
Doing a .Where()
inside a .Include()
is allowed (by the syntax, it fails in execution). However, if you then follow that up with a .ThenInclude()
, like so:
.Include(t => t.Ratings.Where(r => !r.IsDeleted))
.ThenInclude(r => r.User)
You get the following error:
'IEnumerable' does not contain a definition for 'User' and no extension method 'User' accepting a first argument of type 'IEnumerable' could be found (are you missing a using directive or an assembly reference?)
Is this something you're aware of and going to allow in a future version, or am I just doing something wrong and It's already supported?