Awesome Open Source
Awesome Open Source

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

CI

Give a Star! ⭐️

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

Description

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

Architecture Clean Architecture

projects_dependencies

CQRS

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.

Domain

projects_dependencies

Validation

Data validation using FluentValidation

Problem Details for HTTP APIs standard implementation using ProblemDetails

Caching

Using Cache-Aside pattern and in-memory cache.

Integration

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 application

  1. Create empty database.
  2. Execute InitializeDatabase.sql script.
  3. Set connection string (in appsettings.json or by user secrets mechanism).
  4. Run!

How to run Integration Tests

  1. Create empty database.
  2. Execute InitializeDatabase.sql script.
  3. Set connection string using environment variable named ASPNETCORE_SampleProject_IntegrationTests_ConnectionString

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Sharp (277,166
Rest Api (8,367
Dotnet (8,104
Rest (4,156
Design Patterns (1,982
Clean Architecture (1,882
Ddd (1,132
Design System (1,049
Cqrs (1,036
Entity Framework Core (822
Entity Framework (800
Clean Code (744
Domain Driven Design (579
Dapper (300
Software Architecture (192
Mediatr (169
Ddd Example (58
Ddd Cqrs (31
Cqrs Simple (7
Dotnercore (4
Related Projects