{"id":27715691,"url":"https://github.com/hbartosch/routya","last_synced_at":"2026-05-27T07:02:47.796Z","repository":{"id":288597709,"uuid":"967302070","full_name":"HBartosch/Routya","owner":"HBartosch","description":"Routya is a fast, lightweight message dispatching library built for .NET applications that use the CQRS pattern. It provides a flexible way to route requests/responses and notifications to their respective handlers with minimal overhead and high performance.","archived":false,"fork":false,"pushed_at":"2026-04-07T10:45:19.000Z","size":445,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-07T11:08:50.194Z","etag":null,"topics":["c-sharp","csharp","dispatch","dispatcher","dotnet10","dotnet80","dotnet90","dotnetstandard","dotnetstandard20","dotnetstandard21","notification","notifications","parrallel-dispatcher","request","requests","routing","sequential-dispatcher","source-generation","source-generator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HBartosch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"buy_me_a_coffee":"hbartosch","thanks_dev":"gh/hbartosch"}},"created_at":"2025-04-16T08:43:21.000Z","updated_at":"2026-04-07T10:44:06.000Z","dependencies_parsed_at":"2025-04-27T01:09:10.323Z","dependency_job_id":null,"html_url":"https://github.com/HBartosch/Routya","commit_stats":null,"previous_names":["hbartosch/routya"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/HBartosch/Routya","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HBartosch%2FRoutya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HBartosch%2FRoutya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HBartosch%2FRoutya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HBartosch%2FRoutya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HBartosch","download_url":"https://codeload.github.com/HBartosch/Routya/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HBartosch%2FRoutya/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33554781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","csharp","dispatch","dispatcher","dotnet10","dotnet80","dotnet90","dotnetstandard","dotnetstandard20","dotnetstandard21","notification","notifications","parrallel-dispatcher","request","requests","routing","sequential-dispatcher","source-generation","source-generator"],"created_at":"2025-04-27T01:09:07.231Z","updated_at":"2026-05-27T07:02:47.789Z","avatar_url":"https://github.com/HBartosch.png","language":"C#","funding_links":["https://buymeacoffee.com/hbartosch","https://thanks.dev/gh/hbartosch"],"categories":[],"sub_categories":[],"readme":"# Routya\n![CI](https://img.shields.io/github/actions/workflow/status/hbartosch/routya/dotnet.yml?label=CI\u0026style=flat-square)\n![CI](https://img.shields.io/github/actions/workflow/status/hbartosch/routya/build-and-test.yml?label=Tests\u0026style=flat-square)\n[![NuGet](https://img.shields.io/nuget/v/Routya.Core)](https://www.nuget.org/packages/Routya.Core)\n[![NuGet](https://img.shields.io/nuget/dt/Routya.Core)](https://www.nuget.org/packages/Routya.Core)\n![.NET Standard](https://img.shields.io/badge/netstandard-2.0%20%7C%202.1-blue?logo=dotnet\u0026logoColor=white)\n![.NET 8](https://img.shields.io/badge/net-8.0%20%7C%209.0%20%7C%2010-blue?logo=dotnet\u0026logoColor=white)\n\n**Routya** is a fast, lightweight message dispatching library built for .NET applications that use the CQRS pattern.  \nIt provides a flexible way to route requests/responses and notifications to their respective handlers with minimal overhead and high performance.\n\n---\n\n## ⚡ **NEW: v3.0 Source Generator - 46% Faster!**\n\nGet **compile-time code generation** for zero-overhead dispatching:\n\n```bash\ndotnet add package Routya.SourceGenerators --version 3.0.0\n```\n\n```csharp\nusing Routya.Generated;\n\nbuilder.Services.AddGeneratedRoutya(); // Auto-registers all handlers!\n\npublic class MyController : ControllerBase\n{\n    private readonly IGeneratedRoutya _routya;\n    \n    public MyController(IGeneratedRoutya routya) =\u003e _routya = routya;\n    \n    public async Task\u003cUser\u003e GetUser(int id)\n    {\n        return await _routya.SendAsync(new GetUserRequest { UserId = id });\n    }\n}\n```\n\n**Performance:**\n- ⚡ **46% faster** than MediatR on notifications\n- 🔥 **Zero reflection** - all dispatch code generated at compile-time\n- 📦 **Zero dictionary lookups** - direct method calls\n- 🎯 **Full IntelliSense** - type-specific interface with your exact methods\n\n📖 **[Getting Started Guide →](./GETTING_STARTED_V3.md)** | 📦 **[Release Notes →](./RELEASE_NOTES_V3.md)** | 📚 **[Full Docs →](./Routya.SourceGenerators/README.md)**\n\n---\n\n## ✨ Features\n\n- ✅ Clean interface-based abstraction for Requests/Responses and Notifications\n- 🚀 **High-performance dispatching** - Competitive with MediatR while offering more flexibility\n- **⚡ NEW: Source generation** - Compile-time code generation for maximum speed\n- **🌊 NEW: Streaming support** - `IAsyncEnumerable\u003cT\u003e` for large datasets\n- ⚙️ **Configurable handler lifetimes** - Choose Singleton, Scoped, or Transient per handler\n- 🧩 Pipeline behavior support for cross-cutting concerns\n- 🔄 Supports both **sequential** and **parallel** notification dispatching\n- 🎯 **Multi-framework support** - netstandard2.0, netstandard2.1, .NET 8, .NET 9, .NET 10\n- 💾 **Memory efficient** - Zero memory leaks with proper scope management\n- ♻️ Simple to extend and integrate with your existing architecture\n\n---\n\n## 📦 NuGet Packages\n\n### v3.0 - Source Generator (Recommended for new projects)\n```bash\ndotnet add package Routya.SourceGenerators --version 3.0.0\n```\nIncludes `Routya.Core` automatically.\n\n### v2.x - Runtime Dispatcher\n```bash\ndotnet add package Routya.Core --version 2.0.0\n```\nUse for existing projects or when runtime flexibility is needed.\n\n### ⚠️ Breaking Changes in v2.0.0\n\n**1. Pipeline Behavior Delegate Signature Change**\nThe `RequestHandlerDelegate\u003cTResponse\u003e` now requires a `CancellationToken` parameter:\n\n```csharp\n// ❌ Old (v1.x)\npublic delegate Task\u003cTResponse\u003e RequestHandlerDelegate\u003cTResponse\u003e();\n\n// ✅ New (v2.0)\npublic delegate Task\u003cTResponse\u003e RequestHandlerDelegate\u003cTResponse\u003e(CancellationToken cancellationToken);\n```\n\n**Migration Guide:**\nUpdate your pipeline behaviors to pass the `CancellationToken` to the `next()` delegate:\n\n```csharp\n// ❌ Old code (v1.x)\npublic async Task\u003cTResponse\u003e Handle(\n    TRequest request,\n    RequestHandlerDelegate\u003cTResponse\u003e next,\n    CancellationToken cancellationToken)\n{\n    // Your logic before\n    var result = await next(); // ❌ No parameter\n    // Your logic after\n    return result;\n}\n\n// ✅ New code (v2.0)\npublic async Task\u003cTResponse\u003e Handle(\n    TRequest request,\n    RequestHandlerDelegate\u003cTResponse\u003e next,\n    CancellationToken cancellationToken)\n{\n    // Your logic before\n    var result = await next(cancellationToken); // ✅ Pass cancellationToken\n    // Your logic after\n    return result;\n}\n```\n\n**2. Performance Improvements**\n- Registry-based optimization with smart fallback\n- Auto-caching of discovered handlers for improved performance\n- 9-10% faster request dispatching with Singleton/Transient handlers\n- 30% faster notification dispatching with Singleton sequential handlers\n## 🚀 Quick Start\n\n# Dependency injection\nOn startup you can define if **Routya** should create a new instance of the service provider each time it is called or work on the root service provider. \n\nNote!!! By default scope is enabled\n\n# Scoped\nCreates a new DI scope for each dispatch\n- Safely supports handlers registered as Scoped\n- ✅ Use this if your handlers depend on:\n  - EF Core DbContext\n  - IHttpContextAccessor\n  - IMemoryCache, etc.\n```C#\n    builder.Services.AddRoutya(cfg =\u003e cfg.Scope = RoutyaDispatchScope.Scoped, Assembly.GetExecutingAssembly());\n```\n\n# Root\nFastest option \n- avoids creating a service scope per dispatch\n- Resolves handlers directly from the root IServiceProvider\n- ✅ Ideal for stateless handlers that are registered as Transient or Singleton\n- ⚠️ Will fail if your handler is registered as Scoped (e.g., it uses DbContext or IHttpContextAccessor)\n```C#\n    builder.Services.AddRoutya(cfg =\u003e cfg.Scope = RoutyaDispatchScope.Root, Assembly.GetExecutingAssembly());\n```\n\nYou can add an auto registration of IRequestHandler, IAsyncRequestHandler and INotificationHandler by adding the executing assembly. This however registers all your request handlers with the default lifetime (Scoped).\n\nNote!!! By default you would have to manually register your Requests/Notifications and Handlers\n\n```C#\n    builder.Services.AddRoutya(cfg =\u003e cfg.Scope = RoutyaDispatchScope.Scoped, Assembly.GetExecutingAssembly());\n```\n\n# Handler Lifetimes (New in v1.0.5)\n\nConfigure handler lifetimes for optimal performance based on your use case:\n\n### Option 1: Assembly Scanning with Uniform Lifetime\n```C#\n// Register all handlers as Singleton (fastest, stateless handlers only)\nbuilder.Services.AddRoutya(cfg =\u003e cfg.HandlerLifetime = ServiceLifetime.Singleton, Assembly.GetExecutingAssembly());\n\n// Register all handlers as Scoped (default, works with DbContext)\nbuilder.Services.AddRoutya(cfg =\u003e cfg.HandlerLifetime = ServiceLifetime.Scoped, Assembly.GetExecutingAssembly());\n\n// Register all handlers as Transient (new instance every time)\nbuilder.Services.AddRoutya(cfg =\u003e cfg.HandlerLifetime = ServiceLifetime.Transient, Assembly.GetExecutingAssembly());\n```\n\n### Option 2: Optimized Manual Registration (Recommended for Performance)\nUse Routya's specialized registration methods for optimal performance:\n\n```C#\n// Register Routya core services\nbuilder.Services.AddRoutya();\n\n// Use AddRoutyaAsyncRequestHandler for request handlers\nbuilder.Services.AddRoutyaAsyncRequestHandler\u003cCreateProductRequest, Product, CreateProductHandler\u003e(ServiceLifetime.Singleton);\nbuilder.Services.AddRoutyaRequestHandler\u003cGetProductRequest, Product?, GetProductHandler\u003e(ServiceLifetime.Scoped);\n\n// Use AddRoutyaNotificationHandler for notifications\nbuilder.Services.AddRoutyaNotificationHandler\u003cUserRegisteredNotification, SendEmailHandler\u003e(ServiceLifetime.Singleton);\nbuilder.Services.AddRoutyaNotificationHandler\u003cUserRegisteredNotification, LogAuditHandler\u003e(ServiceLifetime.Scoped);\n```\n\n**Why use these methods?**\n- ✅ **Automatic registry population** - Handlers added to high-performance registry\n- ✅ **30% faster** for notifications (110ns vs 158ns with Singleton)\n- ✅ **Type-safe** - Compile-time verification of handler signatures\n- ✅ **Flexible lifetimes** - Choose Singleton/Scoped/Transient per handler\n\n### Option 3: Traditional DI Registration (Still Supported)\nYou can also use standard DI registration - works with auto-caching fallback:\n\n```C#\n// Register Routya core services (no assembly scanning)\nbuilder.Services.AddRoutya();\n\n// Traditional DI registration (automatically cached to registry on first use)\nbuilder.Services.AddSingleton\u003cIAsyncRequestHandler\u003cCreateProductRequest, Product\u003e, CreateProductHandler\u003e();\nbuilder.Services.AddScoped\u003cIAsyncRequestHandler\u003cGetProductRequest, Product?\u003e, GetProductHandler\u003e();\nbuilder.Services.AddTransient\u003cIAsyncRequestHandler\u003cGetAllProductsRequest, List\u003cProduct\u003e\u003e, GetAllProductsHandler\u003e();\n\n// Notification handlers (automatically cached on first publish)\nbuilder.Services.AddSingleton\u003cINotificationHandler\u003cUserRegisteredNotification\u003e, SendEmailHandler\u003e();\n```\n\n**Trade-off**: First call uses standard DI resolution (~5-10% slower), subsequent calls automatically use optimized registry.\n\n**Performance Comparison:**\n- **Singleton**: ~380 ns (2% slower than MediatR, 50% less memory, best for stateless handlers)\n- **Transient**: ~384 ns (3% slower than MediatR, matches memory, maximum isolation)  \n- **Scoped**: ~440 ns (18% overhead, safe for DbContext and scoped dependencies)\n\nRoutya lets YOU choose the right lifetime per handler:\n- 🚀 **Singleton** for stateless handlers = fastest, least memory\n- 🔄 **Scoped** for handlers with DbContext = safe with proper scope management  \n- 🔒 **Transient** when you need maximum isolation = new instance every time\n\n### Backward Compatibility \u0026 Auto-Registry\nRoutya maintains full backward compatibility with traditional DI registration:\n\n```C#\n// Traditional registration (still works!)\nbuilder.Services.AddScoped\u003cIAsyncRequestHandler\u003cMyRequest, MyResponse\u003e, MyHandler\u003e();\nbuilder.Services.AddScoped\u003cINotificationHandler\u003cMyNotification\u003e, MyNotificationHandler\u003e();\n```\n\n**Smart Fallback with Auto-Caching:**\nWhen handlers aren't found in the registry, Routya automatically:\n1. Falls back to `GetService/GetServices` resolution (first call)\n2. **Adds discovered handlers to the registry** (automatic optimization!)\n3. Uses fast registry-based dispatch for all subsequent calls\n\nThis ensures:\n- ✅ **First call**: Fallback resolution (~same speed as traditional)\n- ✅ **Second+ calls**: Registry-optimized dispatch (~28% faster for notifications!)\n- ✅ Smooth migration path from older versions\n- ✅ Works with existing code without changes\n- ✅ Automatic performance improvement after first use\n\n# Requests\n\n### 📊 Benchmark Results (.NET 8 - November 2025)\nBenchmarks comparing Routya against MediatR 13.1.0 with simple request handlers (BenchmarkDotNet v0.14.0)\n\n**Test Environment:**\n- CPU: 11th Gen Intel Core i7-11800H @ 2.30GHz (8 cores, 16 logical processors)\n- RAM: System with AVX-512F support\n- OS: Windows 11 (10.0.22623)\n- .NET: 8.0.17 (8.0.1725.26602), X64 RyuJIT\n- GC: Concurrent Server\n\n#### Request Dispatching Performance\n| Method                     | Mean     | Ratio | Gen0   | Allocated | Notes |\n|--------------------------- |---------:|------:|-------:|----------:|-------|\n| MediatR_SendAsync          | 369.3 ns |  1.00 | 0.0038 |    1016 B | Baseline |\n| **Routya_Singleton_Send**      | **333.9 ns** |  **0.90** | 0.0038 |    1008 B | ⚡ **10% faster!** |\n| **Routya_Transient_Send**      | **336.0 ns** |  **0.91** | 0.0038 |    1032 B | ⚡ **9% faster!** |\n| Routya_Singleton_SendAsync | 397.7 ns |  1.08 | 0.0048 |    1168 B | 8% overhead for async |\n| Routya_Scoped_Send         | 395.5 ns |  1.07 | 0.0048 |    1216 B | Scoped DI overhead |\n| Routya_Transient_SendAsync | 418.0 ns |  1.13 | 0.0048 |    1192 B | 13% overhead for async |\n| Routya_Scoped_SendAsync    | 476.4 ns |  1.29 | 0.0048 |    1376 B | Scoped + async overhead |\n\n**Key Highlights:**\n- ✅ **Singleton/Transient Send handlers are 9-10% faster than MediatR!** 🚀\n- ✅ **Registry-based dispatch** with auto-caching fallback\n- ✅ **Zero memory leaks** with proper scope disposal\n- ✅ **Fast-path optimization** when no behaviors configured\n- 🎯 **Configurable handler lifetimes** (Singleton/Scoped/Transient)\n\nDefine a request\n```C#\n    public class HelloRequest(string name) : IRequest\u003cstring\u003e\n    {\n        public string Name { get; } = name;\n    }\n```\nImplement the Sync handler ...\n```C#\n    public class HelloSyncHandler : IRequestHandler\u003cHelloRequest, string\u003e\n    {\n        public string Handle(HelloRequest request)\n        {\n            return $\"Hello, {request.Name}!\";\n        }\n    }\n```\n\nor Implement the async handler\n```C#\n    public class HelloAsyncHandler : IAsyncRequestHandler\u003cHelloRequest, string\u003e\n    {\n        public async Task\u003cstring\u003e HandleAsync(HelloRequest request, CancellationToken cancellationToken)\n        {\n            return await Task.FromResult($\"[Async] Hello, {request.Name}!\");\n        }\n    }\n```\n\nInject the **IRoutya** interface and dispatch your requests in sync...\n```C#\n    public class Example : ControllerBase\n    {\n      private readonly IRoutya _dispatcher;\n\n      public Example(IRoutya dispatcher)\n      {\n         _dispatcher = dispatcher;\n      }\n    }\n```\n\n```C#\n    _dispatcher.Send\u003cHelloRequest, string\u003e(new HelloRequest(\"Sync World\"));\n```\n\n\nor async\n```C#\n    await _dispatcher.SendAsync\u003cHelloRequest, string\u003e(new HelloRequest(\"Async World\"));\n```\n\n# Pipeline Behaviors\nYou can add pipeline behaviors to execute around your requests. These behaviors need to be registered manually and execute in the order they are registered.\n```C#\n     services.AddScoped(typeof(IPipelineBehavior\u003c,\u003e), typeof(LoggingBehavior\u003c,\u003e));\n     services.AddScoped(typeof(IPipelineBehavior\u003c,\u003e), typeof(ValidationBehavior\u003c,\u003e));   \n```\n\nIn the following example the LoggingBehavior will write to console before your request, wait for the request(in the example above first execute the ValidationBehavior and then in the ValidationBehavior it will execute the request) to execute and then write to the console afterward executing the request.\n```C#\n    public class LoggingBehavior\u003cTRequest, TResponse\u003e : IPipelineBehavior\u003cTRequest, TResponse\u003e\n    {\n        public async Task\u003cTResponse\u003e Handle(\n            TRequest request,\n            Routya.Core.Abstractions.RequestHandlerDelegate\u003cTResponse\u003e next,\n            CancellationToken cancellationToken)\n        {\n            Console.WriteLine($\"[Logging] → {typeof(TRequest).Name}\");\n            var result = await next(cancellationToken); // Pass cancellationToken to next\n            Console.WriteLine($\"[Logging] ✓ {typeof(TRequest).Name}\");\n            return result;\n        }\n    }\n```\n\n# Notifications\n\n### 📊 Notification Dispatching Performance\nBenchmarks comparing Routya against MediatR 13.1.0 for notification patterns (BenchmarkDotNet v0.14.0)\n\n| Method                      | Mean     | Ratio | Gen0   | Allocated | Notes |\n|---------------------------- |---------:|------:|-------:|----------:|-------|\n| MediatR_Publish             | 157.6 ns |  1.00 | 0.0017 |     440 B | Baseline |\n| **Routya_Singleton_Sequential** | **110.5 ns** |  **0.70** | 0.0007 |     192 B | ⚡ **30% faster, 56% less memory!** 🚀 |\n| **Routya_Singleton_Parallel**   | **143.6 ns** |  **0.91** | 0.0012 |     312 B | ⚡ **9% faster, 29% less memory** |\n| **Routya_Transient_Sequential** | **146.0 ns** |  **0.93** | 0.0010 |     240 B | ⚡ **7% faster, 45% less memory** |\n| Routya_Transient_Parallel   | 170.6 ns |  1.08 | 0.0014 |     360 B | 8% slower (parallel overhead) |\n| Routya_Scoped_Sequential    | 238.1 ns |  1.51 | 0.0014 |     424 B | Scoped DI overhead |\n| Routya_Scoped_Parallel      | 265.8 ns |  1.69 | 0.0019 |     544 B | Scoped + parallel overhead |\n\n**Key Highlights:**\n- ✅ **Singleton sequential: 30% faster than MediatR with 56% less memory** (192B vs 440B) 🚀\n- ✅ **Transient sequential: 7% faster with 45% less memory** (240B vs 440B)\n- ✅ **Registry-based dispatch with auto-caching** - Zero GetServices calls after first use\n- ✅ **Parallel dispatching** available with minimal overhead\n- ✅ **Flexible lifetime management** for different use cases\n\nDefine your notification\n```C#\n  public class UserRegisteredNotification(string email) : INotification\n  {\n      public string Email { get; } = email;\n  }\n```\n\nDefine your handlers\n\n```C#\n  public class LogAnalyticsHandler : INotificationHandler\u003cUserRegisteredNotification\u003e\n  {\n      public async Task Handle(UserRegisteredNotification notification, CancellationToken cancellationToken = default)\n      {\n          await Task.Delay(100, cancellationToken);\n          Console.WriteLine($\"📊 Analytics event logged for {notification.Email}\");\n      }\n  }\n```\n\n```C#\n  public class SendWelcomeEmailHandler : INotificationHandler\u003cUserRegisteredNotification\u003e\n  {\n      public async Task Handle(UserRegisteredNotification notification, CancellationToken cancellationToken = default)\n      {\n          await Task.Delay(200, cancellationToken);\n          Console.WriteLine($\"📧 Welcome email sent to {notification.Email}\");\n      }\n  }\n```\n\nInject the **IRoutya** interface and dispatch your notifications sequentially...\n```C#\n    public class Example : ControllerBase\n    {\n      private readonly IRoutya _dispatcher;\n\n      public Example(IRoutya dispatcher)\n      {\n         _dispatcher = dispatcher\n      }\n    }\n```\n\n```C#\n    await dispatcher.PublishAsync(new UserRegisteredNotification(\"john.doe@example.com\"));\n```\n\nor in parallel\n```C#\n     await dispatcher.PublishParallelAsync(new UserRegisteredNotification(\"john.doe@example.com\"));\n```\n\n---\n\n## 🌐 Web API Demos\n\n### Source Generator demo — [`Routya.WebApi.SourceGen.Demo`](./Routya.WebApi.SourceGen.Demo)\n\nThe recommended starting point if you're using `IGeneratedRoutya`. Demonstrates:\n- ✅ **Compile-time dispatch** via `AddGeneratedRoutya()` — no reflection, no assembly scanning\n- ✅ **Open-generic pipeline behavior** (`LoggingBehavior\u003cTRequest, TResponse\u003e`)\n- ✅ **Notification fan-out** — two handlers dispatched in parallel from a single `PublishAsync`\n- ✅ **`IAsyncEnumerable\u003cT\u003e` streaming** — products streamed one by one to the HTTP response\n\n```powershell\ncd Routya.WebApi.SourceGen.Demo\ndotnet run\n# http://localhost:5080\n```\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/products` | List all products |\n| GET | `/products/{id}` | Get a single product |\n| POST | `/products` | Create a product |\n| GET | `/products/stream` | Stream products via `IAsyncEnumerable\u003cT\u003e` |\n| POST | `/orders/{id}/shipped` | Publish a notification to two handlers |\n\n---\n\n### Runtime dispatch demo — [`Routya.WebApi.Demo`](./Routya.WebApi.Demo)\n\nDemonstrates `IRoutya` (runtime reflection-based dispatch) with Entity Framework Core:\n- ✅ **All three handler lifetimes** (Singleton, Scoped, Transient)\n- ✅ **Entity Framework Core** with SQL Server\n- ✅ **Full CRUD operations** via RESTful API\n\n```powershell\ncd Routya.WebApi.Demo\ndotnet run\n# http://localhost:5079\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbartosch%2Froutya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbartosch%2Froutya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbartosch%2Froutya/lists"}