╔══════════════════════════════════════════════════════════╗ ║ dotnet-cqrs Architecture ║ ╚══════════════════════════════════════════════════════════╝ PACKAGE LAYERS ══════════════ ┌─────────────────────────────────────────────────────┐ │ Abstractions (Interfaces) │ │ ICommandHandler IQueryHandler │ │ ICommandDiscovery IQueryDiscovery │ │ IDynamicQuery IQueryableProvider │ └─────────────────────────┬───────────────────────────┘ │ implements ┌─────────────────────────▼───────────────────────────┐ │ Core Implementation │ │ CQRS (discovery + dispatch) │ │ DynamicQuery (OData-like filter/sort/group) │ │ FluentValidation (validators → RFC 7807 errors) │ └─────────────────────────┬───────────────────────────┘ │ exposes via ┌─────────────────────────▼───────────────────────────┐ │ Protocol / Transport │ │ MinimalApi ─── HTTP endpoints (auto-mapped) │ │ Grpc ───────── gRPC endpoints (source-generated) │ │ Grpc.Generators ── compile-time codegen │ └─────────────────────────┬───────────────────────────┘ │ optional ┌─────────────────────────▼───────────────────────────┐ │ Extended Features │ │ Events + Events.RabbitMQ ── event sourcing │ │ Sagas + Sagas.RabbitMQ ─── long-running txns │ │ DynamicQuery.EF ────────── Entity Framework │ │ Notifications ──────────── real-time push │ └─────────────────────────────────────────────────────┘ METADATA-DRIVEN ENDPOINT FLOW ══════════════════════════════ Developer writes handler: ICommandHandler │ ▼ DI registration (AddSvrntyCqrs) │ ▼ Discovery auto-enumerates all handlers │ ▼ ┌────┴────────────────────┐ │ │ ▼ ▼ HTTP: MapSvrntyCommands() gRPC: Source Generator POST /api/command/ CommandServiceImpl createPerson QueryServiceImpl (compile-time generated)