Search code examples
design-patternsarchitectureclean-architecture

Modeling a Net Core Application Using Clean Arch


Well, I have the following flow in my application:

Controller --> *call* --> UseCase --> *call* --> UpdateCustomerGateway

UpdateCustomerGateway have one method updateCustomer(Customer customer) where Usecase can call database to update the customer.

Looking to this image, my doubt is:

I have a namespace called Entites and another called UseCaseDtos. This last have Request and Response Dto to be used in communication with useCases. But when I call UpdateCustomerGateway* I don't know If I pass the Customer (my entity) or CustomerRequestUseCase (my dto).


Solution

  • Gateways/repositories usually work with entities. Gateways create entities from data sources and update data sources from entities.