-
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
Filtered Includes for hidden navigation properties #27493
Comments
There isn't currently a way to do this. In the future we could consider implementing something like this: var posts = context.Posts.Include(e => EF.Property<Blog>(e, "Blog")).ToList();
var blogs = context.Blogs.Include(e => EF.Property<ICollection<Post>>(e, "Posts").OrderBy(c => c.Date)).ToList(); |
This should be very easy to enable if we want to do it. Basically we would make |
In recent releases, EF Core has making big strides in allowing developers to create encapsulated domain models. IMO, this would be another win on that front since it removes the need to have a public navigation to leverage an important feature. |
Design meeting for Navigation or Property. |
Ask a question
Hello, I'm working on an application that uses EF Core to map DDD-style aggregates to a SQL Server database. Several aggregates have private collections which are treated as collections of owned entities. When I query these aggregates, I make use of string-based include statements to eagerly load the collections
This works very well. However I'd like to take advantage of the new filtered-include functionality to apply an order-by clause to children to ensure that children loaded from the database are always retrieved in a specific order.
Is there a way to do this for a private collection, or do I need to make
children
a public property and do something like:Thanks!
The text was updated successfully, but these errors were encountered: