Slipstream 0.0.5

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

Slipstream

Fast, lean CQRS dispatcher with pipeline behaviors.

Slipstream is a lightweight alternative to MediatR focused on doing one thing well — dispatching requests through a pipeline to a single handler. No event publishing, no bloat, just clean request/response dispatching.


Features

  • Request/response dispatching via IDispatcher
  • Void request support (fire-and-forget style)
  • Pipeline behaviors for cross-cutting concerns (logging, validation, transactions, etc.)
  • Reflection-free hot path via cached generic wrappers
  • No dependencies beyond Microsoft.Extensions.DependencyInjection.Abstractions

Installation

dotnet add package Slipstream

Quick Start

1. Define a request

// With a response
public record GetOrderById(int Id) : IRequest<Order>;

// Without a response
public record DeleteOrder(int Id) : IRequest;

2. Implement a handler

public class GetOrderByIdHandler : IRequestHandler<GetOrderById, Order>
{
    public Task<Order> Handle(GetOrderById request, CancellationToken cancellationToken)
    {
        // your logic here
        return Task.FromResult(new Order(request.Id));
    }
}

public class DeleteOrderHandler : IRequestHandler<DeleteOrder>
{
    public Task Handle(DeleteOrder request, CancellationToken cancellationToken)
    {
        // your logic here
        return Task.CompletedTask;
    }
}

3. Register with your DI container

// Scans the assembly and registers all handlers and the dispatcher
builder.Services.AddSlipstream(typeof(GetOrderByIdHandler).Assembly);

// Register behaviors manually in the order you want them to execute
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));

Note: Behaviors are intentionally left to the consumer to register. Order matters — behaviors execute in registration order, so explicit control is by design.

4. Dispatch

public class OrdersController
{
    private readonly IDispatcher _dispatcher;

    public OrdersController(IDispatcher dispatcher)
    {
        _dispatcher = dispatcher;
    }

    public async Task<Order> Get(int id)
    {
        return await _dispatcher.Send(new GetOrderById(id));
    }
}

Pipeline Behaviors

Behaviors wrap handler execution and are ideal for logging, validation, exception handling, and transactions.

public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
    where TRequest : IRequest<TResponse>
{
    private readonly ILogger<LoggingBehavior<TRequest, TResponse>> _logger;

    public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger)
    {
        _logger = logger;
    }

    public async Task<TResponse> Handle(
        TRequest request,
        CancellationToken cancellationToken,
        RequestHandlerDelegate<TResponse> next)
    {
        _logger.LogInformation("Handling {Request}", typeof(TRequest).Name);
        var response = await next();
        _logger.LogInformation("Handled {Request}", typeof(TRequest).Name);
        return response;
    }
}

Behaviors execute in registration order, wrapping the handler like an onion:

Behavior1 -> Behavior2 -> Handler -> Behavior2 -> Behavior1

Why Not MediatR?

MediatR is excellent but carries features many projects don't need — notifications, polymorphic dispatch, and a growing surface area. Slipstream is for teams that want the request/pipeline pattern without the overhead.

Slipstream MediatR
Request/Response ✅ ✅
Pipeline Behaviors ✅ ✅
Notifications ❌ intentional ✅
Reflection-free hot path ✅ ✅ (v12+)
Dependencies Abstractions only Abstractions only

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
0.0.5 139 4/8/2026
0.0.4 118 3/23/2026
0.0.3 110 3/20/2026
0.0.2 104 3/20/2026
0.0.1 109 3/20/2026