Configuration: Memoria Core
Register Memoria in the service collection (Memoria package):
services.AddMemoria(typeof(CreateProduct), typeof(GetProduct));
All command, query, and notification handlers are registered automatically. Pass one type per assembly that contains handlers — CreateProduct is a sample command and GetProduct is a sample query, here assumed to live in two different assemblies.
Optional packages
The core mediator works on its own. Plug in any of the following when you need them:
- Event Sourcing — event-sourcing.md, then pick a store provider:
- Entity Framework Core (with optional Identity support)
- Cosmos DB
- Validation — validation.md
- Messaging — Service Bus, RabbitMQ
- Caching — caching.md
Related
- Quickstart: Mediator — what this registration gets you
- Event Sourcing — the next package up
- Validation
- Caching