# kgrzybek/sample-dotnet-core-cqrs-api

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

Repository: https://github.com/kgrzybek/sample-dotnet-core-cqrs-api
Canonical: https://ross.abutalabs.com/products/sample-dotnet-core-cqrs-api
Homepage: https://www.kamilgrzybek.com/design/simple-cqrs-implementation-with-raw-sql-and-ddd/
Language: C#
License: MIT
License Family: permissive
Topics: ddd, ddd-example, cqrs, cqrs-simple, rest-api, dotnet, dotnercore, clean-architecture, clean-code, dapper, mediatr, domain-driven-design, ddd-cqrs, entity-framework, entity-framework-core, design-patterns, design-systems, software-architecture, rest
Last push: 2024-02-27T17:46:16+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2768, "days_push": 918, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3061, forks 677 (observed 2026-08-28T04:07:41.178772+00:00)

## What it is
A sample .NET Core REST API demonstrating a simple CQRS implementation with Domain-Driven Design using Clean Architecture. It uses raw SQL with Dapper for the read model, Entity Framework Core for the write model, and MediatR for command/query and domain event handling.

## Use cases
- learn how to implement CQRS in .NET Core
- see a Clean Architecture example with DDD
- reference for separating read and write models
- example of using Dapper for raw SQL queries alongside EF Core
- learn the outbox pattern with Quartz.NET
- understand domain event handling with MediatR
- starting point for structuring a REST API with validation and caching

## When to choose
- you want a practical, working reference for CQRS and Clean Architecture in .NET
- you are learning DDD and want to see domain model encapsulation with EF Core
- you need examples of cache-aside, outbox pattern, or ProblemDetails validation in ASP.NET Core

## When to avoid
- you need a production-ready framework or starter template with active feature development
- you need eventual consistency or a full event-sourcing CQRS implementation
- your stack is not .NET/C#

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: web-framework, api-framework, orm, database, caching, middleware, routing, serialization, testing
- domain: backend, web-development, developer-tools, apis, tutorials
- platform: dotnet, cross-platform
- tags: cqrs, clean-architecture, domain-driven-design, ddd, mediatr, dapper, entity-framework-core, rest-api, sample-project, outbox-pattern, fluentvalidation, reference-architecture, web-server

## Member repositories
- kgrzybek/sample-dotnet-core-cqrs-api (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:41.178772+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:28:22.099301+00:00, confidence not recorded.
  - readme: https://github.com/kgrzybek/sample-dotnet-core-cqrs-api (fetched 2026-08-28T04:07:41.178772+00:00, sha 6cc01344e146)
  - homepage: https://www.kamilgrzybek.com/design/simple-cqrs-implementation-with-raw-sql-and-ddd/ (fetched 2026-08-29T09:43:41.282241+00:00, sha 0d347c41bcbf)
  - site_page: https://www.kamilgrzybek.com/about (fetched 2026-08-29T09:43:41.284938+00:00, sha 61f080a2bd9f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
