How data and domain layers communicate with other layers
As discussed in Chapter 7, Understanding the Different Domains in Software Solutions, classical layer architectures use plain objects and repositories to communicate with the other layers.
Therefore, the entities that define Entity Framework Core configuration themselves can be used as they are to communicate with other layers, since they are just record-like lists of public properties, as prescribed for plain objects.
The case of domain layers and onion architectures is slightly more complex, since, in this case, the domain layer communicates with the application layer through rich objects whose methods represent application domain rules. Accordingly, in general, the remainder of the application can’t access all domain layer objects’ properties but is forced to modify them through their own methods, in order to enforce domain rules.
In other words, Entity Framework entities are record-like lists of...