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

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.Binder 10.0.5 (transitive, microsoft)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 (transitive, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 (transitive, microsoft)
  • Microsoft.Extensions.Options 10.0.5 (transitive, microsoft)
  • Microsoft.Extensions.Primitives 10.0.5 (transitive, microsoft)
Product 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. 
Compatible target framework(s)
Included target framework(s) (in 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.0.0 112 10/23/2026