© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
TYoemtais.z

❔ Should I make more transfer classes between layers?

This is also a more general question of whether my architecture makes sense.
I based it on Clean Architecture. (Similar to https://github.com/jasontaylordev/CleanArchitecture)

I have layers:

-Web
-Application
-Infrastructure
-Domain

In domain I have entities declared and domain services / aggregators and validators that deal with business logic.
Entities have very basic business logic, concerning only this entity but most of logic is in services/aggregators.

In application I have commands and queries where I call methods from the domain and eventually map to a DTO that comes out to web.
In application I also receive domain events to, for example, log what happened.

However, I have a problem. Suppose I have a class Car. To it I have a carService that, using the repository, adds, edits or retrieves cars.
And the method is, for example, _carService.UpdateCar(id, name, color, ... 10 more props) or identical _carService.AddCar(name, color, ... 10 more)

I would like to call this in a handler in the application, but passing so many parameters does not appeal to me. What is the best approach? Should I make another transfer class between the application and domain layer?

I was thinking to maybe creating record for such methods, that will act as transfer model for data.
But maybe I should create additional CarEntity, that will only act as transfer from/to DB?

The application will be large and developed over the years. Currently it contains more than 50 different types of entities.
Does my architecture more or less make sense?
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

data transfer between classes
C#CC# / help
4y ago
❔ Whats the difference between classes and public classes?
C#CC# / help
3y ago
✅ ternary select between static classes
C#CC# / help
2y ago
❔ Trying to make this code have classes and inheritence but not sure I should implement this
C#CC# / help
3y ago