Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place and use of MediatR code and Specification code #42

Open
hansmbakker opened this issue Apr 7, 2021 · 1 comment
Open

Place and use of MediatR code and Specification code #42

hansmbakker opened this issue Apr 7, 2021 · 1 comment

Comments

@hansmbakker
Copy link

hansmbakker commented Apr 7, 2021

Hi,

thank you for this great starter repository and for the series of blog articles! I'm still finding my way how to best structure a DDD/CQRS project and your content is really helpful for that.

I was hoping you could help me understand the place and use of the MediatR code and Specification code better.

You put the Specifications in the Core (domain model) project; this seems similar to how the blog I linked above puts Queries in its Domain project.

  • shouldn't the CosmosDbSpecificationEvaluator be in the Infrastructure project then, given that that is likely going to be a specific implementation?
  • I see MediatR being used in the Web API project, and Specifications being used in the Functions project. Can you please explain something about when you choose to use MediatR, and when you choose to use Specifications?
@SKharayat
Copy link

SKharayat commented Oct 25, 2021

@hansmbakker MediatR command and queries responsibility is to orchestrate the application flow and let the information flow from application layer to infrastructure (referencing core layer or models ) and finally to the database, this is the reason I myself keep them in application layer, also as Dto's are not a part of core (as per my view) they also act as ACL's in DDD so they do not need to flow via core layer they can be used in mediatR queries for fetching read-only data in this case also I feel queries should be application layer.
I am myself struggling with structuring CQRS/DDD in my api's, please let me know your views on my inputs and if you have any suggestions that will be awesome .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants