iayti / CleanArchitecture

ASP.NET Core 6 Web API Clean Architecture Solution Template
MIT License
668 stars 119 forks source link

Duplication in mediator handlers #50

Open hanigamini opened 1 year ago

hanigamini commented 1 year ago

How to use duplicate code in handler? Does the static method take up a lot of memory when a lot of data is exchanged? Base on @ShreyasJejurkar It's not recommended to send another request from request handlers. The purpose of using MeditR is just to convert HTTP requests to our application-specific requests and send them into the application layer without letting the controller knows about it or any other presentation layer.

What is the best solution to not occupy a lot of memory? Static method or utility class or service or Application services or abstraction layers or domain layer?

What is the code you suggest?