Routya 4.1.0

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

Routya

The all-in-one Routya package — install this and get everything you need.

NuGet NuGet


What's Included

Package Description
Routya.Core High-performance CQRS dispatcher — request/response, notifications, pipeline behaviors
Routya.SourceGenerators Compile-time source generator — zero reflection, type-specific dispatch, 55% less memory than MediatR on notifications

Instead of installing both packages separately, install Routya and both are pulled in automatically, including the source generator.


Installation

dotnet add package Routya

That's it. No second package to remember.


Quick Start

1. Define handlers

using Routya.Core.Abstractions;

public record GetUserRequest(int UserId) : IRequest<User>;
public record User(int Id, string Name);

public class GetUserHandler : IAsyncRequestHandler<GetUserRequest, User>
{
    public Task<User> HandleAsync(GetUserRequest request, CancellationToken ct)
        => Task.FromResult(new User(request.UserId, $"User_{request.UserId}"));
}

public class UserCreatedNotification : INotification
{
    public int UserId { get; set; }
}

public class EmailHandler : INotificationHandler<UserCreatedNotification>
{
    public Task Handle(UserCreatedNotification notification, CancellationToken ct = default)
    {
        Console.WriteLine($"Sending email for user {notification.UserId}");
        return Task.CompletedTask;
    }
}

2. Register

using Routya.Generated;

services.AddGeneratedRoutya(); // source generator wires everything up at compile-time

3. Dispatch

var routya = provider.GetRequiredService<IGeneratedRoutya>();

var user = await routya.SendAsync(new GetUserRequest(123));
await routya.PublishAsync(new UserCreatedNotification { UserId = 456 });

Example Projects

See working demos in the GitHub repository:

Source generator path (IGeneratedRoutya)

Project Description
Routya.WebApi.SourceGen.Demo ASP.NET Core minimal API — CRUD, pipeline behaviors, notification fan-out, IAsyncEnumerable<T> streaming
Routya.WebApi.SourceGen.Demo.Application The class library holding the handlers for the API above. Shows referenced assembly discovery and [RoutyaHandler] lifetime overrides
Routya.SourceGen.Demo Console app — request/response and notifications, an open-generic request pipeline behavior, and IStreamRequest<T> streaming wrapped in a stream pipeline behavior
Routya.SourceGen.DatabaseDemo Console app — commands and queries against an in-memory SQLite database, with notifications on write

Runtime dispatch path (IRoutya)

Project Description
Routya.WebApi.Demo ASP.NET Core — EF Core with SQL Server, all three handler lifetimes, IStreamRequest<T> streaming straight from the database
Routya.Demo Console app — scoped dispatch, synchronous and asynchronous sends, two stacked pipeline behaviors
Routya.Notification.Demo Console app — PublishAsync and PublishParallelAsync side by side
Routya.Demo.NetFramework .NET Framework 4.8 — confirms Routya.Core runs on the full framework

Full Documentation

  • Routya.Core docs — runtime dispatcher, pipeline behaviors, scoped dispatch, notification strategies
  • Routya.SourceGenerators docs — how the source generator works, generated code, performance benchmarks, migration guide

There are no supported framework assets in this 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
4.1.0 234 10/1/2026
4.0.0 159 9/29/2026
3.1.0 2,351 5/27/2026