Lyo.FeatureFlags.AspNetCore
3.0.0
dotnet add package Lyo.FeatureFlags.AspNetCore --version 3.0.0
NuGet\Install-Package Lyo.FeatureFlags.AspNetCore -Version 3.0.0
<PackageReference Include="Lyo.FeatureFlags.AspNetCore" Version="3.0.0" />
<PackageVersion Include="Lyo.FeatureFlags.AspNetCore" Version="3.0.0" />
<PackageReference Include="Lyo.FeatureFlags.AspNetCore" />
paket add Lyo.FeatureFlags.AspNetCore --version 3.0.0
#r "nuget: Lyo.FeatureFlags.AspNetCore, 3.0.0"
#:package Lyo.FeatureFlags.AspNetCore@3.0.0
#addin nuget:?package=Lyo.FeatureFlags.AspNetCore&version=3.0.0
#tool nuget:?package=Lyo.FeatureFlags.AspNetCore&version=3.0.0
Lyo.FeatureFlags.AspNetCore
UseFeatureFlags runs after routing and authentication, and before authorization, so a disabled flag is 404 instead of 401. It does not register IFeatureFlagService. The host still calls AddFeatureFlags or AddFeatureFlagsFromConfiguration. An open route does not resolve the service. A gated route with no service returns an empty 500. A flag that is off returns an empty 404 and does not run the handler. MapFeatureFlags lists the names that are on for the same caller. MapFeatureFlagManagement lists every flag and turns one flag on or off. The host authorizes those management routes.
Features
- [RequireFeature] on an MVC controller or action. Several attributes must all be enabled.
- Minimal APIs. A method-group attribute is metadata. A lambda or a route group uses RequireFeature.
- Caller mapping. User id is lyo:user, then sub, then NameIdentifier, then Identity.Name. There is no tenant claim unless TenantClaimType is set. A space-delimited scope claim is split. Attributes stay empty unless ContextFactory sets them.
- ContextFactory. Replaces that mapping. A null return is an anonymous caller.
- GET /features. MapFeatureFlags returns names IsEnabled accepts for that caller. Disabled names, rules, and percentages are omitted. No service returns an empty 500.
- Manage. MapFeatureFlagManagement maps GET /features/manage to every flag's name and mode, and PUT /features/manage/{name} to turn that flag on or off. An unknown name is an empty 404. No service is an empty 500.
Examples
Gate a route
builder.Services.AddFeatureFlags(o => o.Add("checkout").On());
app.UseRouting();
app.UseAuthentication();
app.UseFeatureFlags();
app.UseAuthorization();
app.MapGet("/checkout", Checkout).RequireFeature("checkout");
app.MapFeatureFlags();
app.MapFeatureFlagManagement().RequireAuthorization();
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Exceptions(direct, lyo)Lyo.FeatureFlags(direct, lyo)Microsoft.Extensions.Configuration.Binder10.0.5(transitive, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Options10.0.5(transitive, microsoft)Microsoft.Extensions.Primitives10.0.5(transitive, microsoft)
| 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
- Lyo.Exceptions (>= 3.0.0)
- Lyo.FeatureFlags (>= 3.0.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 |
|---|---|---|
| 3.0.0 | 112 | 10/23/2026 |