Replies: 8 comments
-
They're named @VictorioBerra what do you think? I'm not sure if this should be the new default, it does make sense somewhat. |
Beta Was this translation helpful? Give feedback.
-
I almost replied to this yesterday but wanted to see your thoughts @RehanSaeed if we are talking about a simple move+rename, I think thats just fine. @rkqiku send a PR. I checked other CQRS sample repos and notice this pattern: https://github.com/kgrzybek/sample-dotnet-core-cqrs-api/tree/master/src/SampleProject.API/Orders/GetCustomerOrderDetails ( Alternatively, I see people make a new folder for Queries and keep them separate like that, which seems nice. |
Beta Was this translation helpful? Give feedback.
-
I was thinking of a straight rename. If I was going to do subfolders, Wouldn't you prefer to make subfolders based on the controller name:
As opposed to this
|
Beta Was this translation helpful? Give feedback.
-
@RehanSaeed there's definitely a trend doing it the first way I have noticed, naming folders by feature. I like the first way but either works! |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your feedbacks! I will try my first PR here. |
Beta Was this translation helpful? Give feedback.
-
I thought about this some more. The beginning of the file has the HTTP method in it |
Beta Was this translation helpful? Give feedback.
-
If you're going to do it the CQRS I think there's value in distinguishing commands vs queries at the class name and file name level. Also, I don't think the mapping between http verbs and query/command is a duplication. It sure maps naturally in most cases but it's easy to imagine exceptions to the rule (a POST request mapped to a query) |
Beta Was this translation helpful? Give feedback.
-
Sorry for coming back to this after some time. Things got on top of me. If you go with class name e.g. There is a danger that people are going to get confused between the command pattern and CQRS pattern because both use the word 'Command'. Ideally, I'd like to avoid that somehow. |
Beta Was this translation helpful? Give feedback.
-
Question
Does it make more sense to separate Queries and Commands?
Currently, everything is named as command.
I mean, is it better to name GET as Queries (GetCarQuery) and POST, PUT etc as Commands (PostCarCommand)?
Project template
API
Environment
Beta Was this translation helpful? Give feedback.
All reactions