© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
15 replies
Bailey

✅ 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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to structure this DTO?
C#CC# / help
4y ago
❔ MediatR and saga
C#CC# / help
3y ago
❔ StructureMap.StructureMapException: StructureMap Exception Code: 207
C#CC# / help
3y ago
MediatR commands and DTOs [Answered]
C#CC# / help
4y ago