Dragonfire.Features 8.3.3

dotnet add package Dragonfire.Features --version 8.3.3
                    
NuGet\Install-Package Dragonfire.Features -Version 8.3.3
                    
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="Dragonfire.Features" Version="8.3.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dragonfire.Features" Version="8.3.3" />
                    
Directory.Packages.props
<PackageReference Include="Dragonfire.Features" />
                    
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 Dragonfire.Features --version 8.3.3
                    
#r "nuget: Dragonfire.Features, 8.3.3"
                    
#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 Dragonfire.Features@8.3.3
                    
#: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=Dragonfire.Features&version=8.3.3
                    
Install as a Cake Addin
#tool nuget:?package=Dragonfire.Features&version=8.3.3
                    
Install as a Cake Tool

Dragonfire.Features

Feature toggle and release-gate library for .NET 8 — built for B2B2C platforms that need different tiers, early-access cohorts, and gradual rollouts without a roundtrip to a SaaS flag service.

Packages

Package Purpose
Dragonfire.Features Core: [FeatureGate], IFeatureResolver, IFeatureSource, in-memory store, periodic refresh hosted service, audit log abstraction
Dragonfire.Features.AspNetCore Action filter, endpoint filter, RequireFeature("..."), HttpContext-aware accessor
Dragonfire.Features.Configuration IConfiguration source — appsettings, env, Azure App Configuration
Dragonfire.Features.EntityFrameworkCore EF Core source + audit log persistence (any provider)
Dragonfire.Features.Caching Dragonfire.Caching decorator that caches decisions per (feature, tenant, user)

Quick start

builder.Services.AddDragonfireFeatures(o =>
{
    o.RefreshInterval = TimeSpan.FromSeconds(30);
});
builder.Services.AddDragonfireFeaturesConfiguration(builder.Configuration);
builder.Services.AddDragonfireFeaturesAspNetCore();
// appsettings.json
{
  "Features": {
    "NewCheckout": {
      "DefaultEnabled": false,
      "Tenants": [ "acme", "globex" ],
      "Percentage": 25,
      "PercentageBucket": "TenantThenUser"
    }
  }
}
[FeatureGate("NewCheckout")]
public class CheckoutController : ControllerBase { ... }

app.MapPost("/orders", CreateOrder).RequireFeature("NewCheckout");

Rule semantics

Rules are evaluated in order; the first non-null verdict wins. If every rule abstains, FeatureDefinition.DefaultEnabled is the final answer.

  • TenantAllowListRule — grants when the current tenant id is in the list, otherwise abstains.
  • UserAllowListRule — grants when the current user id is in the list, otherwise abstains.
  • PercentageRule — stable FNV-1a hash of (featureName, bucketKey) mod 100; grants when the bucket is below the threshold. Bucket key prefers tenant id, then user id; anonymous calls abstain so they don't randomly flip on every request.

Sources

IFeatureSource.LoadAllAsync() is called every refresh tick. When two sources advertise the same feature name, the source registered later in DI wins — register configuration first, EF Core second to let the database override appsettings.

The refresh service uses PeriodicTimer directly rather than the Dragonfire.Poller library: Poller targets request/response polling with retry/backoff, not "tick every N seconds forever". Refreshing a feature snapshot is the latter.

Audit log

Every refresh that produces a non-empty diff calls IFeatureAuditLog.RecordAsync with one entry per added / updated / removed feature. The default NoOpFeatureAuditLog discards entries; the EF Core integration persists them to features.FeatureAudit for B2B compliance.

Caching integration

AddDragonfireFeaturesCaching() decorates the resolver. Each decision is cached as features:{feature}:{tenantOrNone}:{userOrNone} with tags features:{feature} and features-tenant:{tenantId}. Flush a single tenant's slice with cacheService.InvalidateByTagAsync("features-tenant:acme").

TenantContext

The AspNetCore accessor reads tenant id from a configurable header (default X-Tenant-Id) or claim. Users on Dragonfire.TenantContext can swap in their own IFeatureContextAccessor that reads ITenantContextAccessor.CurrentDragonfire.Features deliberately avoids a hard dependency on TenantContext.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (4)

Showing the top 4 NuGet packages that depend on Dragonfire.Features:

Package Downloads
Dragonfire.Features.Configuration

IConfiguration-backed feature source for Dragonfire.Features. Reads feature definitions and rules from the standard Microsoft.Extensions.Configuration pipeline (appsettings.json, environment variables, Azure App Configuration, etc.) and reloads them on the periodic refresh cycle.

Dragonfire.Features.Caching

Dragonfire.Caching integration for Dragonfire.Features. Wraps the default IFeatureResolver in a decorator that caches per (feature, tenant, user) tuple via ICacheService, with tag-based invalidation per tenant. Decisions stay hot for high-RPS endpoints while still respecting the next refresh cycle.

Dragonfire.Features.AspNetCore

ASP.NET Core integration for Dragonfire.Features: action filter and endpoint filter that honour [FeatureGate] attributes, RequireFeature() endpoint extension, and HttpContext-aware IFeatureContextAccessor that reads tenant id from a configurable header/claim and user id from the authenticated principal.

Dragonfire.Features.EntityFrameworkCore

Entity Framework Core integration for Dragonfire.Features. Persists feature definitions, rules and audit history to any EF Core provider (SQL Server, PostgreSQL, SQLite, etc.). Provides EfCoreFeatureSource and EfCoreFeatureAuditLog plus an ApplyFeatureConfigurations() ModelBuilder extension that you call from your own DbContext.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.3.3 171 5/2/2026
8.3.2 167 5/1/2026