We should split the reading and writing of domain objects apart (with CQRS or Event sourcing). This involves writing better encapsulation within the domain objects (making set accessor of properties to private and adding methods to create and validate objects (at the same time) within the domain object itself. Here are some approaches that I have used before:
We should split the reading and writing of domain objects apart (with CQRS or Event sourcing). This involves writing better encapsulation within the domain objects (making set accessor of properties to private and adding methods to create and validate objects (at the same time) within the domain object itself. Here are some approaches that I have used before:
https://www.thereformedprogrammer.net/three-approaches-to-domain-driven-design-with-entity-framework-core/
eShopOnContainers Order.API has done a good job of this also.