The current N-Tier style architecture which references EFCore entities directly in the controllers was a quick and dirty first pass to make the system work.
I want to undertake a refactor that accomplishes two things...
1) refactor controllers / services away from N-Tier style architecture which composes horizontal slices of the domain and towards DDD style 'UseCase' where each operation represents an entire vertical slice of the domain.
2) Apply CQRS at a logical level where each 'UseCase' is either a Command (which modifies state) or a Query (which reads state). All commands from an entity should live in one place and all queries for an entity should in another place. Commands vs Queries should receive separate treatment with respect to logging / caching etc.
The current N-Tier style architecture which references EFCore entities directly in the controllers was a quick and dirty first pass to make the system work.
I want to undertake a refactor that accomplishes two things...
1) refactor controllers / services away from N-Tier style architecture which composes horizontal slices of the domain and towards DDD style 'UseCase' where each operation represents an entire vertical slice of the domain.
2) Apply CQRS at a logical level where each 'UseCase' is either a Command (which modifies state) or a Query (which reads state). All commands from an entity should live in one place and all queries for an entity should in another place. Commands vs Queries should receive separate treatment with respect to logging / caching etc.