jasontaylordev / NorthwindTraders

Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is CQRS put in Application and not in WebUI?

despotive opened this issue · comments

Hello

In this project the CQRS is located in the Application project, but in all other projects I've seen, such has the eShopOnWeb project or the aspnetcore-realworld-example-app, the CQRS is always located in the API / WebUI project (and I think that in both project the clean architecture is mostly respected although naming might differ).

Could someone explain the rationale?

Thanks!

There is no one solution to all architectures. In those two, it is organised more as a Features in UI section.
What if you want to use Command both from controller and some scheduled task.
When you put Commands in Application layer, they become reusable from other components.

It really depends how you want to put your architecture, but as always, whatever is your decision, be consistent with it.

Thank you for your interest in this project. This repository has been archived and is no longer actively maintained or supported. We appreciate your understanding. Feel free to explore the codebase and adapt it to your own needs if it serves as a useful reference. If you have any further questions or concerns, please refer to the README for more information.