Fusonic.Extensions.Mediator
9.3.1
Prefix Reserved
See the version list below for details.
dotnet add package Fusonic.Extensions.Mediator --version 9.3.1
NuGet\Install-Package Fusonic.Extensions.Mediator -Version 9.3.1
<PackageReference Include="Fusonic.Extensions.Mediator" Version="9.3.1" />
paket add Fusonic.Extensions.Mediator --version 9.3.1
#r "nuget: Fusonic.Extensions.Mediator, 9.3.1"
// Install Fusonic.Extensions.Mediator as a Cake Addin #addin nuget:?package=Fusonic.Extensions.Mediator&version=9.3.1 // Install Fusonic.Extensions.Mediator as a Cake Tool #tool nuget:?package=Fusonic.Extensions.Mediator&version=9.3.1
Mediator
This project contains a simple implementation of the common mediator pattern. The implementation focused on simplifying version 11.1.0 of the MediatR package. The pipelining was removed (SimpleInjector has a powerful built-in decorator feature) and a pure mediator implementation based on SimleInjector remains.
ICommand
, IQuery
: Use those instead of directly using the IRequest
interfaces to clearly distinguish between commands and queries.
OutOfBandAttribute
: You can put this on your Handler
-class. When used together with the Hangfire-Decorator, the execution of the handler will be queued as a background job automatically.
Registration
To register the mediator as well as your customer command/notification-handlers, use the following extenion where you can provide all the assemblies you want to scan for handlers.
container.RegisterMediator(services, [ typeof(Program).Assembly ]);
Mediator transaction handling
When using the RegisterMediator
method from above, all requests and notifications will run within a TransactionScope.
To disable this feature, configure as following:
container.RegisterMediator(services, [ typeof(Program).Assembly ], configure =>
{
EnableTransactionalDecorators = false;
});
Custom IMediator implementation
When using the RegisterMediator
method from above, our default SimpleInjectorMediator will be registered.
If you want to use your custom mediator, configure as following:
container.Options.AllowOverridingRegistrations = true;
container.RegisterSingleton(typeof(IMediator), typeof(MyCustomMediator));
class MyCustomMediator : IMediator
{
...
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Fusonic.Extensions.Common (>= 9.3.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- SimpleInjector (>= 5.4.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Fusonic.Extensions.Mediator:
Package | Downloads |
---|---|
Fusonic.Extensions.Hangfire
Provides Hangfire extensions, especially suited for CQRS development. (Out of band processing). |
|
Fusonic.Extensions.AspNetCore
Provides ASP.NET Core extensions (Middelwares, Utilities ...) |
|
Fusonic.Extensions.Email
Contains common functionality for rendering email templates using razor engine and sending emails via MailKit. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.5.0 | 146 | 10/4/2024 |
9.4.0 | 262 | 9/23/2024 |
9.3.1 | 226 | 9/11/2024 |
9.3.0 | 123 | 9/11/2024 |
9.2.0 | 165 | 8/8/2024 |
9.2.0-rc.3 | 51 | 8/7/2024 |
9.2.0-rc.2 | 35 | 8/5/2024 |
9.2.0-rc.1 | 47 | 8/1/2024 |
9.1.0 | 91 | 7/29/2024 |
9.0.0 | 521 | 7/17/2024 |
9.0.0-preview.2 | 66 | 6/13/2024 |
9.0.0-preview.1 | 113 | 4/5/2024 |