SaintMichaelKit.LiteMediator
1.1.1
dotnet add package SaintMichaelKit.LiteMediator --version 1.1.1
NuGet\Install-Package SaintMichaelKit.LiteMediator -Version 1.1.1
<PackageReference Include="SaintMichaelKit.LiteMediator" Version="1.1.1" />
<PackageVersion Include="SaintMichaelKit.LiteMediator" Version="1.1.1" />
<PackageReference Include="SaintMichaelKit.LiteMediator" />
paket add SaintMichaelKit.LiteMediator --version 1.1.1
#r "nuget: SaintMichaelKit.LiteMediator, 1.1.1"
#:package SaintMichaelKit.LiteMediator@1.1.1
#addin nuget:?package=SaintMichaelKit.LiteMediator&version=1.1.1
#tool nuget:?package=SaintMichaelKit.LiteMediator&version=1.1.1
SaintMichaelKit.LiteMediator
Lightweight and modular Mediator implementation for in-process messaging in .NET, focusing on simplicity, extensibility, and performance.
Package | Version | Downloads |
---|---|---|
SaintMichaelKit.LiteMediator |
Features
- ✅ Simple in-process mediator pattern implementation.
- ✅ Support for request/response and notification messaging.
- ✅ Automatic registration of handlers via assembly scanning.
- ✅ Support for pipeline behaviors for cross-cutting concerns (validation, logging, exception handling, etc.).
Installation
Install via NuGet Package Manager:
dotnet add package SaintMichaelKit.LiteMediator --version 1.*
Or via Package Manager Console:
Install-Package SaintMichaelKit.LiteMediator -Version 1.*
Usage
Register the Mediator and behaviors in your DI container:
services.AddSimpleMediator();
services.AddMediatorBehavior<ValidationPipelineBehavior<,>>();
services.AddMediatorBehavior<ExceptionHandlingPipelineBehavior<,>>();
services.AddMediatorBehavior<RequestLoggingPipelineBehavior<,>>();
Define your requests and handlers:
public class MyRequest : IRequest<MyResponse>
{
public int Value { get; set; }
}
public class MyResponse
{
public string Message { get; set; }
}
public class MyRequestHandler : IRequestHandler<MyRequest, MyResponse>
{
public async Task<MyResponse> Handle(MyRequest request, CancellationToken cancellationToken)
{
return new MyResponse { Message = $"Processed {request.Value}" };
}
}
Sending requests and publishing notifications:
var mediator = serviceProvider.GetRequiredService<IMediator>();
// Send a request and get response
var response = await mediator.Send(new MyRequest { Value = 42 });
// Publish a notification
await mediator.Publish(new MyNotification { /* ... */ });
Documentation
Check out the GitHub repository for full documentation, examples, and source code.
Changelog
See the CHANGELOG.md for details on new features, bug fixes, and version history.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SaintMichaelKit.LiteMediator:
Package | Downloads |
---|---|
SaintMichaelKit
Biblioteca utilitária modular para aplicações .NET com foco em organização, integração e extensibilidade. |
GitHub repositories
This package is not used by any popular GitHub repositories.