Skip to content
Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.
Branch: master
Clone or download
Latest commit d960220 Jun 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Add images for README Feb 13, 2019
src Refactor - rename adding order to placing Jun 18, 2019
.gitignore Initial commit Feb 3, 2019 Update Jun 18, 2019

Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.

Give a Star! ⭐️

If you like this project, learn something or you are using it in your applications, please give it a star. Thanks!


Sample .NET Core REST API application implemented with basic CQRS approach and Domain Driven Design.

Architecture Clean Architecture



Read Model - executing raw SQL scripts on database views objects (using Dapper).

Write Model - Domain Driven Design approach (using Entity Framework Core).

Commands/Queries/Domain Events handling using MediatR library.




Data validation using FluentValidation

Problem Details for HTTP APIs standard implementation using ProblemDetails


Using Cache-Aside pattern and in-memory cache.


Outbox Pattern implementation using Quartz.NET

Related blog articles

Simple CQRS implementation with raw SQL and DDD

Domain Model Encapsulation and PI with Entity Framework 2.2

REST API Data Validation

Domain Model Validation

How to publish and handle Domain Events

Handling Domain Events: Missing Part

Cache-Aside Pattern in .NET Core

The Outbox Pattern

How to run

  1. Create empty database.
  2. Execute InitializeDatabase.sql script.
  3. Set connection string (in appsettings.json or by user secrets mechanism).
  4. Run!
You can’t perform that action at this time.