Nice example, I like how the ICommand and IQuery markers are used just to drive pipeline behavior. Curious if Spyros ran into any friction later when adding more cross cutting concerns.
How I Built a CQRS Approval Flow with MediatR, Carter, FluentValidation, and SQLite
2 Comments
Spyros
•
@[Ben Kiehl]
MediatR uses the same base interface (IRequest) for both commands and queries. At first it looks like it breaks the separation, but in practice it doesn’t violate Single Responsibility, because IRequest is just a transport contract.
In my case, the ICommand and IQuery markers are only there to drive pipeline behavior. For example, in TransactionBehavior I wrap only commands in a transaction, then commit when the command completes successfully. Queries skip that behavior completely.
Please log in to add a comment.
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
chevron_left
55Posts
203Comments
157Connections
Passionate about building robust and scalable software solutions with a focus on .NET technologies. ... Show morePassionate about building robust and scalable software solutions with a focus on .NET technologies. With extensive experience in leading teams, designing systems, and mentoring developers, I strive to deliver high-quality, efficient, and maintainable code. I share insights, tutorials, and best practices to help others grow in their software engineering journey. Always eager to learn, explore, and contribute to the tech community
https://www.linkedin.com/in/spyros-ponaris-913a6937/ Show less
https://www.linkedin.com/in/spyros-ponaris-913a6937/ Show less
More From Spyros
Related Jobs
- SigmaFlow SME - Data EngineerCypress HCM · Full time · United States
- Software Engineer III - Cloud Security - FCS Workflow (Hybrid)Unknown Company · Full time · New York, NY
- Senior Software Engineer - EDR Workflows - SecurityElastic · Full time · Canada
Commenters (This Week)
danielmartintech
1 comment
joente
1 comment
Devananda A
1 comment
Contribute meaningful comments to climb the leaderboard and earn badges!