A sample .NET Core REST API demonstrating CQRS with raw SQL, DDD, and Clean Architecture.
Sample .NET Core CQRS API is a reference implementation of a REST API built with .NET Core that demonstrates the CQRS pattern, Domain-Driven Design, and Clean Architecture. It provides a practical example of separating read and write operations using raw SQL for queries and Entity Framework Core for commands, helping developers understand how to structure scalable and maintainable backend applications.
.NET developers and software architects looking to learn or implement CQRS, DDD, and Clean Architecture in their projects. It's particularly useful for those building enterprise-level APIs who need a clear separation of concerns and robust domain modeling.
Developers choose this project because it offers a well-documented, production-ready example of modern .NET architectural patterns in one cohesive codebase. It combines multiple best practices—like raw SQL optimization, domain encapsulation, and event handling—into a single reference, saving time compared to piecing together disparate tutorials.
Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements CQRS, DDD, and Clean Architecture together in a cohesive example, with clear layer separation and domain modeling as shown in the architecture and domain diagrams.
Uses raw SQL with Dapper for queries in the read model, which is highlighted for better performance compared to ORM-based approaches, as per the CQRS implementation details.
Integrates outbox pattern with Quartz.NET for domain events, ensuring reliable integration with external systems, as detailed in the related blog articles linked in the README.
Employs Problem Details for error handling, making HTTP API responses consistent and adherent to standards, which is specified in the validation section.
Requires creating an empty database and executing SQL scripts manually, adding complexity to deployment and setup, as outlined in the 'How to run application' steps.
Integration tests need specific environment variables for connection strings, which can be error-prone and cumbersome for CI/CD pipelines, as mentioned in the testing instructions.
Heavy reliance on MediatR, Dapper, and EF Core may lead to vendor lock-in, making it difficult to swap out components without significant refactoring, given the integrated approach.