✅ Theoretical question. MediatR and DTO and onion structure
Hello,
THe following is just theoretical and I do not need any code
In the programming world, transferring the received object from the api to other parts of the programm for processing is seen as bad practise.
Keeping this in mind, then we should map the received data (could use automapper).
However if I use the onion structure in combination with Mediatr, there is a mapping done automaticly. The reason why I think this is because MediatR (if I'm correct) uses reflection and generic types. This means that there already is a mapping (indirect).
Now I think about using this structure without the mappings.
ps. If I would use n-tier structure the mapping would go to the same properties in the object only from the contract to the dto.
My question what are you're thoughts on this.
THe following is just theoretical and I do not need any code
In the programming world, transferring the received object from the api to other parts of the programm for processing is seen as bad practise.
Keeping this in mind, then we should map the received data (could use automapper).
However if I use the onion structure in combination with Mediatr, there is a mapping done automaticly. The reason why I think this is because MediatR (if I'm correct) uses reflection and generic types. This means that there already is a mapping (indirect).
Now I think about using this structure without the mappings.
ps. If I would use n-tier structure the mapping would go to the same properties in the object only from the contract to the dto.
My question what are you're thoughts on this.