Elarion.FeatureFlags.FeatureManagement
0.2.3-preview.45.1
dotnet add package Elarion.FeatureFlags.FeatureManagement --version 0.2.3-preview.45.1
NuGet\Install-Package Elarion.FeatureFlags.FeatureManagement -Version 0.2.3-preview.45.1
<PackageReference Include="Elarion.FeatureFlags.FeatureManagement" Version="0.2.3-preview.45.1" />
<PackageVersion Include="Elarion.FeatureFlags.FeatureManagement" Version="0.2.3-preview.45.1" />
<PackageReference Include="Elarion.FeatureFlags.FeatureManagement" />
paket add Elarion.FeatureFlags.FeatureManagement --version 0.2.3-preview.45.1
#r "nuget: Elarion.FeatureFlags.FeatureManagement, 0.2.3-preview.45.1"
#:package Elarion.FeatureFlags.FeatureManagement@0.2.3-preview.45.1
#addin nuget:?package=Elarion.FeatureFlags.FeatureManagement&version=0.2.3-preview.45.1&prerelease
#tool nuget:?package=Elarion.FeatureFlags.FeatureManagement&version=0.2.3-preview.45.1&prerelease
<div align="center">
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/swimmesberger/Elarion/main/docs/public/brand/elarion-banner-transparent-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/swimmesberger/Elarion/main/docs/public/brand/elarion-banner-transparent-light.svg"> <img src="https://raw.githubusercontent.com/swimmesberger/Elarion/main/docs/public/brand/elarion-banner-transparent-light.svg" width="640" alt="Elarion — Application framework for .NET"> </picture>
Module-based handler pipelines, compile-time registration, JSON-RPC hosting, MCP tools for AI agents, and scheduled jobs.
Declare intent next to your code; let source generators do the wiring. No runtime reflection scanning.
AI-native by design: the same handlers that power your API are exposed to AI agents as MCP tools — generated from your code at compile time, with no separate tool definitions or duplicated schemas.
</div>
Elarion's central idea is simple: your application assemblies define modules and handlers; your
host assembly only wires infrastructure, transport, and deployment. Everything that can be
discovered from your code — handlers, validators, services, scheduled jobs, RPC methods, EF Core
DbSets — is emitted by source generators at compile time instead of scanned by reflection at
startup.
[Handler("clients.get")]
public sealed class GetClient(AppDbContext db)
: IHandler<GetClient.Query, Result<GetClient.Response>> {
public sealed record Query(Guid Id);
public sealed record Response(Guid Id, string Name);
public async ValueTask<Result<Response>> HandleAsync(Query query, CancellationToken ct) {
var client = await db.Clients
.Where(c => c.Id == query.Id)
.Select(c => new Response(c.Id, c.Name))
.FirstOrDefaultAsync(ct);
return client is null
? AppError.NotFound($"Client {query.Id} was not found.")
: client;
}
}
That one class is a use case, a registered service, a JSON-RPC method, an MCP tool for AI agents,
and (optionally) a schema-exported TypeScript contract — with no entry added to any Program.cs
registration list. The operation name is optional: [Handler] alone infers {module}.{operation} by
convention (here clients.get), while an explicit name is recommended for stable public/wire contracts.
Why Elarion
- Compile-time, not reflection — handlers, services, validators, modules, RPC maps, and scheduled jobs become ordinary DI code. Startup is deterministic and AOT-friendly; missing wiring is a build error, not a runtime surprise.
- Modules own their surface — a module is a namespace plus an
[AppModule]marker. Add a handler under it and the module publishes it automatically. - Transport-neutral results — handlers return
Result<T>with a transport-agnosticAppError; the host maps failures to JSON-RPC, HTTP, or anything else. - One bus, many surfaces — every handler maps onto a single transport-neutral
HandlerDispatcher(Elarion.Abstractions.Dispatch); JSON-RPC and MCP are thin adapters over that one bus, each serving only the operations flagged for it. Define a handler once and choose its surfaces with theTransportsflag. - End-to-end JSON-RPC — mark a handler with
[Handler], export a schema at build time, and generate a typed TypeScript + Zod client. - AI-native, no extra code — expose the same
[Handler]handlers to AI agents as an MCP server. MCP is an adapter over the sharedHandlerDispatcher, so a tool is just a handler flaggedHandlerTransports.Mcp. Tool names, descriptions, and input schemas are generated from your handlers and[Description]attributes at compile time — no separate tool layer, no duplicated schemas, no runtime reflection. Choose a handler's transports with[Handler(Transports = …)](JSON-RPC, MCP, or both) and rename a tool with[McpHandler]. - Feature flags & variants — gate any handler with
[FeatureGate]; a generated decorator evaluates the flag before the handler runs and a closed gate returns 404 Not Found, so a disabled feature is indistinguishable from one that doesn't exist (the name is never leaked).[FeatureVariant]swaps a[Service]implementation per user behind a flag. Both work identically under JSON-RPC, MCP, and HTTP, against any OpenFeature provider. - Exactly-once command handlers — mark a handler
[Idempotent]and the idempotency key commits atomically with the business writes, a retried request replays the stored result, a concurrent duplicate returns 409, and there is no distributed lock. - In-process scheduling — source-generated scheduled jobs with explicit overlap, misfire, and resilience policies.
- Observable by default — JSON-RPC, scheduling, caching, and resilience emit
OpenTelemetry-compatible traces and metrics through
System.Diagnostics, with no SDK dependency forced on you.
Install
<ItemGroup>
<PackageReference Include="Elarion" Version="0.2.2" />
</ItemGroup>
// Turn the generators on, once per assembly
[assembly: UseElarion]
The Quickstart builds a module, a handler, and a working JSON-RPC endpoint end to end.
Packages
| Package | Purpose |
|---|---|
Elarion.Abstractions |
Attributes and contracts: [AppModule], [Service], [ScheduledJob], IHandler<,>, Result<T>, AppError. |
Elarion |
Runtime primitives: decorators, the in-memory scheduler, current-user access, and the default authorizer. Depends only on Microsoft.Extensions.* abstractions (ADR-0017) — caching and resilience moved to their own opt-in packages. Bundles the Elarion source generator (handlers, services, validators, modules, RPC/HTTP/MCP maps, resilience policies, scheduled jobs, event consumers). |
Elarion.Caching |
HybridCache-backed default IHandlerCache for handler result caching (AddElarionHandlerCaching()). Required by [Cacheable]/[CacheInvalidate] (extracted from core, ADR-0017). |
Elarion.Caching.PostgreSql |
The recommended L2 distributed cache for most apps: a PostgreSQL UNLOGGED table behind HybridCache (AddElarionPostgreSqlHandlerCaching(connectionString)). Reuse your Postgres instead of operating a separate Redis (Redis still wins for very high-throughput or multi-region caches; ADR-0020). |
Elarion.Resilience |
Microsoft/Polly-backed default IResiliencePipelineRunner (AddMicrosoftResilienceRuntime()). Required by [Resilient] handlers and deferred scheduler retries (extracted from core, ADR-0017). |
Elarion.FeatureFlags.OpenFeature |
Default IFeatureFlagService over OpenFeature for [FeatureGate]/[FeatureVariant]; maps ICurrentUser into the evaluation context off-HTTP (AddElarionOpenFeature()). Bring your own OpenFeature provider. |
Elarion.FeatureFlags.FeatureManagement |
Batteries-included config-driven flags via the Microsoft.FeatureManagement OpenFeature provider (AddElarionFeatureManagement(configuration)). |
Elarion.Blobs |
Provider-neutral blob storage contracts and DTOs. |
Elarion.Blobs.PostgreSql |
PostgreSQL-backed blob storage with EF Core model configuration and Npgsql content I/O, plus the pending/commit/TTL upload lifecycle and garbage collector. |
Elarion.Blobs.AspNetCore |
Minimal direct blob-upload endpoint (MapElarionBlobUploads) for FilePond and plain fetch/<form> clients. |
Elarion.Blobs.Tus |
tus 1.0 resumable-upload transport (MapElarionTus) — the open, resumable, large-file protocol supported natively by Uppy and tus-js-client. |
Elarion.Blobs.Tus.PostgreSql |
Durable PostgreSQL staging for tus uploads so in-progress uploads survive restarts. |
Elarion.Messaging.InMemory |
In-memory integration-event bus (best-effort, commit-gated by the EF Core transaction). |
Elarion.Messaging.Outbox |
EF Core transactional outbox: a durable, at-least-once integration-event bus with a polling delivery worker. |
Elarion.Paging |
Keyset (cursor) and offset pagination primitives, opaque cursor codec, and IQueryable paging extensions. |
Elarion.JsonRpc |
Transport-neutral JSON-RPC dispatcher, envelopes, telemetry, and schema export. |
Elarion.AspNetCore |
ASP.NET Core JSON-RPC endpoint mapping, [HttpEndpoint] minimal-API mapping, batch execution, and current-user middleware. |
Elarion.AspNetCore.Mcp |
Exposes your handlers as a Model Context Protocol (MCP) server for AI agents, over Streamable HTTP — an MCP adapter over the shared HandlerDispatcher. |
Elarion.AspNetCore.SchemaGeneration |
MSBuild package that exports rpc-schema.json during dotnet build. |
Elarion.EntityFrameworkCore |
Marker attributes for generated DbSets and entity inclusion. Bundles the EF Core source generator (DbSet properties, entity configuration, keyset pagination). |
Elarion.EntityFrameworkCore.Identity |
The web-free ASP.NET Core Identity model: [GenerateElarionIdentity] + ApplyElarionIdentity compose a snake_case Identity model onto a plain DbContext (no ASP.NET FrameworkReference). Bundles its model generator. |
Elarion.AspNetCore.Identity |
Optional ASP.NET Core Identity host wiring: AddElarionIdentity<…> (AddIdentity + EF stores), the Identity ICurrentUser claim mapping, and the transport-neutral authorizer. |
Elarion.EntityFrameworkCore.UnitOfWork |
Framework-owned EF transaction / unit-of-work boundary: EfUnitOfWork<TDbContext> over the EF-free IUnitOfWork seam (PostgreSQL SET LOCAL lock_timeout + savepoints), AddElarionUnitOfWork<TDbContext>(). |
Elarion.Idempotency.EntityFrameworkCore |
Durable exactly-once key store: EfCoreIdempotencyStore<TDbContext> (INSERT … ON CONFLICT DO NOTHING inside the caller's transaction, 409 on lock_timeout, success-only replay) plus a retention purge worker, AddElarionIdempotencyEntityFrameworkCore<TDbContext>(). |
Elarion.Authorization.EntityFrameworkCore |
Data-level authorization grants backend: a ResourceGrant table (user/role shares), IResourceGrantStore, and the grants-backed IResourceAuthorizer. |
Elarion.Settings |
Runtime-changeable key/value settings: the swappable ISettingsStore sink (global and per-user scopes, in-process change notification) plus the AOT-clean ISettingsManager consumer. |
Elarion.Settings.EntityFrameworkCore |
EF Core database backend for settings: a relational, provider-neutral ISettingsStore with optimistic concurrency. |
Elarion.Settings.Configuration |
IConfiguration/IOptionsMonitor adapter over the Global settings scope, with IChangeToken reload so config consumers pick up runtime changes. |
@swimmesberger/elarion-jsonrpc-client-generator |
TypeScript CLI that turns a schema export into method contracts, Zod schemas, and a fetch client. |
Documentation
Full guides live at elarion.wimmesberger.dev and in docs/:
- Introduction · Why Elarion · Installation · Quickstart
- Concepts — source generation, handlers, results & errors, modules, services, validators, pipelines, cross-module communication
- Capabilities — hosting, HTTP endpoints, JSON-RPC, MCP server, authorization, feature flags, identity, scheduling, resilience, events & messaging, EF Core, caching, current user, blob storage, telemetry
- Reference — packages, configuration, troubleshooting
Requirements
- .NET 10 SDK or later
- ASP.NET Core for the JSON-RPC HTTP transport
- Node.js 18+ for the TypeScript client generator
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md for the development workflow, validation commands, architecture boundaries, and the publishing process. By participating you agree to the Code of Conduct.
Security
Please report vulnerabilities privately — see the security policy.
License
Elarion is licensed under the Apache License 2.0.
| Product | Versions 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. |
-
net10.0
- Elarion.FeatureFlags.OpenFeature (>= 0.2.3-preview.45.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- OpenFeature.Contrib.Provider.FeatureManagement (>= 0.1.2-preview)
- OpenFeature.Hosting (>= 2.14.0)
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.2.3-preview.45.1 | 0 | 7/1/2026 |
| 0.2.3-preview.44.1 | 0 | 7/1/2026 |
| 0.2.3-preview.43.1 | 0 | 7/1/2026 |
| 0.2.3-preview.42.1 | 0 | 7/1/2026 |
| 0.2.3-preview.41.1 | 0 | 7/1/2026 |
| 0.2.3-preview.40.1 | 0 | 7/1/2026 |
| 0.2.3-preview.39.1 | 25 | 6/30/2026 |
| 0.2.3-preview.38.1 | 30 | 6/30/2026 |
| 0.2.3-preview.37.1 | 35 | 6/30/2026 |