You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it on the roadmap to support more operations in Filtered Includes? I'm specifically wanting to use OrderByDescending (currently supported) + DistinctBy (currently unsupported) to get multiple max values.
Include your code
I'm using comments instead of actual EF Core configuration/attribution
Ex:
publicclassParentEntity{publiclongId{get;set;}// owned entitiespublicList<ChildEntityRevision> ChildEntityRevisions {get;set;}// I want the ability to do this 👇🏽 in a Filtered IncludepublicIEnumerable<ChildEntityRevision> CurrentRevisions
=> ChildEntityRevisions.OrderByDescending(x => x.Version).DistinctBy(x => x.StableKey);// if the former is enabled then this 👇🏽 is trivial to also do via filtered include with an extra `Where` and `Take(1)`publicChildEntityRevision?GetCurrentRevisionOrDefault(longstableKey)=> CurrentRevisions.SingleOrDefault(x => x.StableKey ==stableKey);}publicclassChildEntityRevision{publiclongStableKey{get;set;}// increases with each new revision publiclongVersion{get;set;}}
Include stack traces
N/A
Include verbose output
N/A
Include provider and version information
N/A
The text was updated successfully, but these errors were encountered:
@roji thanks for creating that, I've went ahead and upvoted it.
Out of curiosity, do you know if there's already an issue for using GroupBy (in my case with a nested OrderByDescending(…).Take(1) or OrderByDescending(…).First()) in a filtered include? I'm not sure if that would be more palatable to implement or not, but that's another way to accomplish what I want.
Ask a question
Is it on the roadmap to support more operations in Filtered Includes? I'm specifically wanting to use
OrderByDescending
(currently supported) +DistinctBy
(currently unsupported) to get multiple max values.Include your code
I'm using comments instead of actual EF Core configuration/attribution
Ex:
Include stack traces
N/A
Include verbose output
N/A
Include provider and version information
N/A
The text was updated successfully, but these errors were encountered: