What problem does it solve?
It prevents compile-time and runtime errors caused by confusing FSH’s Mediator source-generator CQRS interfaces with MediatR, and it clarifies the exact handler/registration contracts you must follow.
Core Features & Use Cases
- Use the correct CQRS interfaces: Commands and queries use
ICommand<TResponse> / IQuery<TResponse> and handlers use ICommandHandler<,> / IQueryHandler<,> (not MediatR’s IRequest<> patterns).
- Implement handlers correctly: Handler methods must return
ValueTask<T> and follow the expected parameter naming conventions and coding style.
- Register new modules in the Mediator scan lists: Ensures the source generator scans the right Contracts and runtime assemblies by updating both required host Program entry points.
- Common error diagnosis: Explains typical symptoms (missing interfaces, wrong
Task vs ValueTask, handlers not being invoked) and maps them to fixes.
Quick Start
Use the mediator-reference skill as your checklist when adding a new module so your command/query contracts, handler signatures, and Mediator assembly registration match FSH’s source-generator expectations.