Routya 3.1.0

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

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:

Project Description
Routya.WebApi.SourceGen.Demo ASP.NET Core minimal API — CRUD, pipeline behaviors, notification fan-out, IAsyncEnumerable<T> streaming
Routya.SourceGen.Demo Console app — basic request/response and notification dispatch

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
3.1.0 97 5/27/2026