I tend to put all these kinds of classes in the use cases project. I'll have a structure using feature folders something like:
Features
Orders
Payments
Shipping
For cross-cutting stuff like checking a user's role, etc. I would create another folder in the root of the use case projects called "Gates".
If a specific gate class is really tied to a specific feature of the application, which is rare since they are mostly useful for cross-cutting kinds of concerns like checking user permissions etc., then I would just make a "Gates" folder in the features folder:
Orders
Gates (folder)
PlaceStandardOrderCommand.cs (use case)
GetActiveOrderForUserQuery.cs (use case)
...and more use cases...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Where do you put your gate classes in your project package/folder structure?
Usually, I have a project structure like:
web (app layer) -> use cases -> domain project
I tend to put all these kinds of classes in the use cases project. I'll have a structure using feature folders something like:
For cross-cutting stuff like checking a user's role, etc. I would create another folder in the root of the use case projects called "Gates".
If a specific gate class is really tied to a specific feature of the application, which is rare since they are mostly useful for cross-cutting kinds of concerns like checking user permissions etc., then I would just make a "Gates" folder in the features folder: