samedi 25 septembre 2021

When using the CQRS pattern, should the Handler class be responsible for calling the DTO-to-Domain mapper?

I have DTO called FooDTO that is sent to or from the FooController. I also have a mapper class that maps FooDTO to my domain entity Foo. To keep my controllers slim, I am using the Mediatr to implement CQRS. Should the Handler for Foo be responsible for calling the mapping function? Or should this happen elsewhere such as a layer in the pipeline before it?

Aucun commentaire:

Enregistrer un commentaire