MinimalMediatR 1.0.3

dotnet add package MinimalMediatR --version 1.0.3
                    
NuGet\Install-Package MinimalMediatR -Version 1.0.3
                    
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="MinimalMediatR" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinimalMediatR" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="MinimalMediatR" />
                    
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 MinimalMediatR --version 1.0.3
                    
#r "nuget: MinimalMediatR, 1.0.3"
                    
#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 MinimalMediatR@1.0.3
                    
#: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=MinimalMediatR&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=MinimalMediatR&version=1.0.3
                    
Install as a Cake Tool

MinimalMediatR

MinimalMediatR is a lightweight and extensible implementation of MediatR.

✨ Features

  • Send/Receive pattern (IRequest<T> + IRequestHandler<T, R>)
  • Publish/Subscribe event model (INotification + INotificationHandler<T>)
  • Middleware support via IPipelineBehavior<TRequest, TResponse>
  • Auto-registration with AddMinimalMediatR(...)

🚀 Quick Start

services.AddMinimalMediatR(typeof(MyHandler).Assembly);

🧱 Sample Query

public class GetUserQuery : IRequest<User> 
{ 
    public int Id { get; set; } 
}

public class GetUserQueryHandler : IRequestHandler<GetUserQuery, User>
{
    public Task<User> Handle(GetUserQuery request, CancellationToken cancellationToken) =>
        Task.FromResult(new User { Id = request.Id, Name = $"User {request.Id}" });
}

🔔 Sample Notification

public class UserCreatedEvent : INotification
{
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
}

public class UserCreatedEventHandler : INotificationHandler<UserCreatedEvent>
{
    public Task Handle(UserCreatedEvent notification, CancellationToken cancellationToken)
    {
        Console.WriteLine($"User created: {notification.Name}");
        return Task.CompletedTask;
    }
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 MinimalMediatR:

Package Downloads
Adoroid.Core.Application

Adoroid.Core is a modular .NET Core library that brings together essential infrastructure components commonly used across backend projects. It's designed to be reusable, extendable, and easy to integrate into your applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 213 4/25/2025