SaintMichaelKit.LiteMediator 1.1.1

dotnet add package SaintMichaelKit.LiteMediator --version 1.1.1
                    
NuGet\Install-Package SaintMichaelKit.LiteMediator -Version 1.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SaintMichaelKit.LiteMediator" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SaintMichaelKit.LiteMediator" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="SaintMichaelKit.LiteMediator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SaintMichaelKit.LiteMediator --version 1.1.1
                    
#r "nuget: SaintMichaelKit.LiteMediator, 1.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SaintMichaelKit.LiteMediator@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SaintMichaelKit.LiteMediator&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=SaintMichaelKit.LiteMediator&version=1.1.1
                    
Install as a Cake Tool

SaintMichaelKit.LiteMediator

Lightweight and modular Mediator implementation for in-process messaging in .NET, focusing on simplicity, extensibility, and performance.

Package Version Downloads
SaintMichaelKit.LiteMediator NuGet Nuget

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.1.1 96 6/6/2025
1.1.0 101 6/6/2025
1.0.0 149 5/30/2025