microsoft/CQRS.Mediatr.Lite
54.5
Adequate · 21 September 2026
1.2k
lines of production code
C#
primary language
4
measurements over time
What this system is
CQRS.Mediatr.Lite is a lightweight .NET SDK that implements the Command Query Responsibility Segregation (CQRS) pattern using MediatR. It provides core infrastructure for handling commands, queries, and domain events, including support for local and remote execution, dependency injection, and Domain-Driven Design primitives like aggregates and value objects. The system is designed to simplify the construction of ASP.NET Core APIs with clear separation between read and write operations.
Features
Initial release of the CQRS.Mediatr.Lite SDK
This change introduces the initial codebase for the CQRS.Mediatr.Lite SDK, establishing the core infrastructure for Command, Query, and Event handling. It provides base classes for Commands, Queries, and Events, along with corresponding handler abstractions and a central RequestHandler base that enforces request validation. The SDK includes local CommandBus, EventBus, and QueryService implementations that resolve handlers via a dependency injection resolver and support pre/post-processing hooks. Additionally, it adds remote execution capabilities via RemoteCommandBus and RemoteQueryService for deserializing and dispatching requests by name, as well as Domain-Driven Design support through AggregateRoot, Enumeration, and ValueObject base classes.
src/sdk · high confidence
New CQRS sample project demonstrating order management
Added a new sample project, CQRS.Mediatr.Lite.Samples.NetCoreApi, that demonstrates the Command Query Responsibility Segregation (CQRS) pattern using Mediatr.Lite. The sample includes a complete ASP.NET Core API with an OrdersController exposing endpoints to create, retrieve, ship, and deliver orders. It implements domain logic via an OrderAggregateRoot with value objects for Customer, Product, and OrderStatus, and uses in-memory repositories and event stores for persistence and event handling. The solution also includes command and query handlers, event handlers for domain events (OrderCreated, OrderShipped, OrderDelivered), and dependency injection configuration via Autofac.
samples · high confidence
Test coverage
Initial integration and unit test suite for CQRS.Mediatr.Lite
Added a comprehensive test suite covering the core CQRS components, including CommandBus, EventBus, QueryService, and their remote counterparts. The changes introduce integration tests to verify end-to-end request handling and unit tests for domain entities like AggregateRoot and Enumeration, alongside mock implementations for handlers, processors, and events to support these validations.
src/tests · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 52 → 54 (+2.2)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 83 → 81 (-1.5)
- Architecture 69 → 69 (+0.0)
- Maturity 45 → 45 (+0.0)
- Readiness 52 → 60 (+8.3)
- Security 66 → 67 (+1.4)
- Performance 60 → 60 (+0.0)
Resolved (10)
- Coverage not measured — analyzer environment
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Monorepo: only 1 of 2 solutions was scored
- No exposed public API
- The Samples link points to a GitHub repo that is not the CQRS.Mediatr.Lite project; it may direct users away from the library. (README.md)
- dormant codebase — no living knowledge left to concentrate
New (18)
- CoverageExclusion (src/sdk/Query/Remote/GenericEntitiesQuery.cs)
- CoverageExclusion (src/sdk/Query/Remote/GenericEntitiesQueryResponse.cs)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (src/sdk/Internal/CommandHandlerWrapper.cs)
- Duplicated block (9 lines × 2) (src/sdk/Internal/QueryHandlerWrapper.cs)
- End-of-life runtime: .NET net5.0
- End-of-life runtime: .NET net6.0
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Inconsistent naming for validation/error handling concepts: 'AssertRaisesException' is used in test helpers, while 'Validate' is used in domain/mock objects. While these are different contexts (test assertion vs domain logic), the parameter name 'errorValidationMessage' in RequestValidationException and 'ValidationErrorMessage' in the same exception suggests a mix of 'Error' and 'Validation' terminology. More critically, MockCommand.Validate returns a string (likely error message), whereas AssertRaisesException asserts on an exception. This is less of a naming inconsistency and more of a design observation, but looking closer at RequestValidationException, it has both CustomExceptionMessage and ValidationErrorMessage. This is a minor inconsistency in property naming within the same exception class.
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Release publish has no approval gate
- Typo in test method name: 'EventHanders' is missing a 'd' compared to the standard 'EventHandler' spelling used elsewhere in the codebase.
- Typo in test method name: 'EvntHandler' is used instead of 'EventHandler', while another test in the same class correctly uses 'EventHandlers'.
- redundant comment (src/sdk/Internal/EventHandlerWrapper.cs)
Changes since last survey
- 2 commits — 2 feature/other, 0 fixes
By area
- (repo) — 1 commit
- .github/workflows — 1 commit
Notable commits
- change: Merge pull request #14 from danfiedler-msft/danfiedler/pin-actions
- change: Pin GitHub Actions to full-length commit SHAs
API surface
- Unchanged — 3 HTTP endpoints
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
microsoft/CQRS.Mediatr.Lite was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 23343c786072a54fa824319d02663b328cd2ae3a — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.