NotifyR 1.0.1

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

NotifyR

NuGet License Docs

<a id="readme-top"></a>

<div align="center"> <h3 align="center">NotifyR</h3> <p align="center"> A lightweight mediator library for .NET with support for requests, notifications, and pipeline behaviors. <br /> <a href="https://nick-vanduijn.github.io/NotifyR"><strong>Read the docs »</strong></a> <br /> <br /> <a href="https://www.nuget.org/packages/NotifyR">View NuGet Package</a> · <a href="https://github.com/nick-vanduijn/NotifyR/issues">Report Bug</a> · <a href="https://github.com/nick-vanduijn/NotifyR/issues/new/choose">Request Feature</a> </p> </div>

Table of Contents

About

NotifyR is a DI-first mediator implementation for .NET inspired by MediatR. It provides in-process message passing with support for typed requests, void requests, notifications, and pipeline behaviors.

Features

  • Request/response handlers with compile-time type safety
  • Void requests for fire-and-forget workflows
  • Notifications with one or more handlers
  • Pipeline behaviors for cross-cutting concerns such as logging, validation, and caching
  • Minimal overhead on the hot path

Built With

  • .NET 10
  • Microsoft.Extensions.DependencyInjection

Getting Started

Prerequisites

  • .NET SDK 10.0 or later

Installation

dotnet add package NotifyR

Quick Start

using Microsoft.Extensions.DependencyInjection;
using NotifyR;

var services = new ServiceCollection();

services.AddNotifyR(cfg =>
{
    cfg.RegisterServicesFromAssemblyContaining<GetUser>();
});

var provider = services.BuildServiceProvider();
var mediator = provider.GetRequiredService<IMediator>();

Usage

Requests

public class GetUser : IRequest<GetUserResponse>
{
    public int UserId { get; init; }
}

public class GetUserResponse
{
    public string Name { get; init; } = string.Empty;
}

public class GetUserHandler : IRequestHandler<GetUser, GetUserResponse>
{
    public Task<GetUserResponse> Handle(GetUser request, CancellationToken ct)
    {
        return Task.FromResult(new GetUserResponse { Name = $"User_{request.UserId}" });
    }
}

var user = await mediator.Send(new GetUser { UserId = 42 });

Void Requests

public class Ping : IRequest { }

public class PingHandler : IRequestHandler<Ping>
{
    public Task<Unit> Handle(Ping request, CancellationToken ct)
    {
        Console.WriteLine("Ping received!");
        return Unit.Completed;
    }
}

await mediator.Send(new Ping());

Notifications

public class UserCreated : INotification
{
    public int UserId { get; init; }
}

public class LogUserCreated : INotificationHandler<UserCreated>
{
    public Task Handle(UserCreated notification, CancellationToken ct)
    {
        Console.WriteLine($"User created: {notification.UserId}");
        return Task.CompletedTask;
    }
}

await mediator.Publish(new UserCreated { UserId = 7 });

Pipeline Behaviors

public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
    where TRequest : IRequest<TResponse>
{
    public async Task<TResponse> Handle(
        TRequest request,
        RequestHandlerDelegate<TRequest, TResponse> next,
        CancellationToken ct)
    {
        Console.WriteLine($"Handling {typeof(TRequest).Name}");
        var response = await next(request, ct);
        Console.WriteLine($"Handled {typeof(TRequest).Name}");
        return response;
    }
}

License

Distributed under the MIT License. See LICENSE for details.

Contact

Project Link: https://github.com/nick-vanduijn/NotifyR

Documentation: https://nick-vanduijn.github.io/NotifyR

<p align="right"><a href="#readme-top">back to top</a></p>

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 120 7/5/2026
1.0.0-preview.1 60 7/4/2026