-
Notifications
You must be signed in to change notification settings - Fork 9
Home
João Simões edited this page Oct 22, 2020
·
17 revisions
Small .NET library that helps with the implementation of mediator pattern for commands, events and queries.
Using a mediator instance, send commands, broadcast events and fetch queries from their respective generic handlers.
Check the rest of the documentation for more details:
- Mediator - mediator concepts and how to use it;
- Commands - commands, command handlers and how send works;
- Events - events, event handlers and how broadcast works;
- Queries - queries, query handlers and how fetch works;
- Middleware - explanation about the command, event and query pipeline;
- Configuration (and Dependency Injection) - how core instances behave and how can they be configured in a dependency injection container;
- Logging - how to enable mediator logging via wrappers or middleware;
The library is available via NuGet packages:
NuGet | Description | Version |
---|---|---|
SimpleSoft.Mediator.Abstractions | interfaces and abstract implementations (commands, events, queries, mediator, ...) | |
SimpleSoft.Mediator | core implementation | |
SimpleSoft.Mediator.Microsoft.Extensions | specialized methods and classes for the Microsoft dependency injection container and logging facades | |
SimpleSoft.Mediator.Microsoft.Extensions.EFCoreTransactionPipeline | mediator pipeline to enforce Entity Framework Core transactions | |
SimpleSoft.Mediator.Microsoft.Extensions.LoggingPipeline | pipeline that serializes commands, queries, events and results into the logging | |
SimpleSoft.Mediator.Microsoft.Extensions.ValidationPipeline | pipeline that enforces validation into commands, queries and events before entering the handlers by using FluentValidation
|
Install-Package SimpleSoft.Mediator.Abstractions
Install-Package SimpleSoft.Mediator
Install-Package SimpleSoft.Mediator.Microsoft.Extensions
Install-Package SimpleSoft.Mediator.Microsoft.Extensions.EFCoreTransactionPipeline
Install-Package SimpleSoft.Mediator.Microsoft.Extensions.LoggingPipeline
Install-Package SimpleSoft.Mediator.Microsoft.Extensions.ValidationPipeline
dotnet add package SimpleSoft.Mediator.Abstractions
dotnet add package SimpleSoft.Mediator
dotnet add package SimpleSoft.Mediator.Microsoft.Extensions
dotnet add package SimpleSoft.Mediator.Microsoft.Extensions.EFCoreTransactionPipeline
dotnet add package SimpleSoft.Mediator.Microsoft.Extensions.LoggingPipeline
dotnet add package SimpleSoft.Mediator.Microsoft.Extensions.ValidationPipeline
This library is compatible with the following frameworks:
-
SimpleSoft.Mediator.Abstractions
- .NET Framework 4.0+;
- .NET Standard 1.0+;
-
SimpleSoft.Mediator
- .NET Framework 4.0+;
- .NET Standard 1.0+;
-
SimpleSoft.Mediator.Microsoft.Extensions
- .NET Standard 1.1+;
-
SimpleSoft.Mediator.Microsoft.Extensions.EFCoreTransactionPipeline
- .NET Standard 1.3+;
-
SimpleSoft.Mediator.Microsoft.Extensions.LoggingPipeline
- .NET Standard 1.1+;
-
SimpleSoft.Mediator.Microsoft.Extensions.ValidationPipeline
- .NET Standard 1.1+;
Usage examples of the mediator: