CQRS is simpler than you think with C#9 and .NET 5!
summary
Claims CQRS is much simpler when using .NET 5 and C#9, implemented here without Event Sourcing or DDD by building a working WebAPI (about 167 lines of code) that uses C#9 records and Endpoints map post/get patterns. Uses EF Core 5 DbContext, nullable reference types with smart constructors, command/query handler interfaces (no MediatR), returns 201 on create, deconstructs records for neat handlers, and keeps vertical slices so each business operation is isolated and testable.
AI-written summary · about
chapters (15)
- 0:00Introduction to CQRS
- 1:38What CQRS means
- 6:19Commands and queries explained
- 15:52Data models and records
- 17:01Minimal APIs in .NET 5
- 18:28Endpoint routing setup
- 22:50Structuring code with slices
- 27:47Refining endpoint logic
- 31:36Business logic separation
- 34:47Command and query handlers
- 37:16Simplified handler execution
- 39:50Performance optimizations
- 40:52Benefits of CQRS structure
- 41:56Missing features and future
- 42:38Summary and Q&A
related talks
30mSimple Architecture for a Not-So-Simple System
52mCQRS, DDD and GraphQL, a perfect fit?
46mCQRS, DDD and GraphQL, a perfect fit
49mCQRS and Event Sourcing: Higher-Level Software Architecture for Everyone!
49mThe Evolution and Myths of CQRS
30mEventSourcing and CQRS — The Introduction That Was Missing
50mMoving away from CRUD: DDD + CQRS
46mLet’s Get Minimal: .NET 6 New APIs in ASP.NET Core
