Open LukasKubicek opened 2 years ago
You may want to consider making Email an owned entity.
Owned entities have a lot of other implications and limitations. Making an entity owned for the sake of auto-including is pit of failure.
I would like to promote this again. The AutoInclude feature is very useful, but it is unfortunate that it is not available via DataAnnotations on Model classes directly.
Yes, another example is the Author
for a Topic
and a Reply
connected by AuthorId
.
AutoInclude is a not much documented, but very useful feature since ef core 5, that allows you to load related entities automatically with model builder like this:
builder.Navigation(x => x.ContactEmails).AutoInclude();
I would like to be able to configure this by data annotaions on the model like this: