GovBuilt.FeatureFlags.Abstraction
1.0.4
dotnet add package GovBuilt.FeatureFlags.Abstraction --version 1.0.4
NuGet\Install-Package GovBuilt.FeatureFlags.Abstraction -Version 1.0.4
<PackageReference Include="GovBuilt.FeatureFlags.Abstraction" Version="1.0.4" />
<PackageVersion Include="GovBuilt.FeatureFlags.Abstraction" Version="1.0.4" />
<PackageReference Include="GovBuilt.FeatureFlags.Abstraction" />
paket add GovBuilt.FeatureFlags.Abstraction --version 1.0.4
#r "nuget: GovBuilt.FeatureFlags.Abstraction, 1.0.4"
#:package GovBuilt.FeatureFlags.Abstraction@1.0.4
#addin nuget:?package=GovBuilt.FeatureFlags.Abstraction&version=1.0.4
#tool nuget:?package=GovBuilt.FeatureFlags.Abstraction&version=1.0.4
GovBuilt.FeatureFlags.Abstraction
Private package — GovBuiltFeed only. Do not publish to nuget.org.
A lightweight helper library for checking per-tenant feature flags in any GovBuilt module or application.
Add this package to any module that needs to check flags.
The GovBuilt.FeatureFlags module must be enabled on the tenant — it owns storage and registers the helper.
What this package does
- Provides
IFeatureFlagHelperfor reading feature flags anywhere in the application - Provides
FeatureFlagSetting— the single source of truth for all flag definitions - Provides
AddFeatureFlagHelper()extension method for DI registration - Degrades gracefully: returns all-
falsedefaults when theGovBuilt.FeatureFlagsmodule is disabled
What this package does NOT
- Store or write flag values
- Create controllers or endpoints
- Read configuration from
appsettings.json
Prerequisites
- .NET 8
- Orchard Core application
GovBuilt.FeatureFlagsmodule enabled on the tenant
Installation
Step 1: Add the private feed (once per machine)
dotnet nuget add source "https://pkgs.dev.azure.com/MCCinnovations/_packaging/GovBuiltFeed/nuget/v3/index.json" \
--name GovBuiltFeed \
--username az \
--password <PAT>
Step 2: Add the package reference
<PackageReference Include="GovBuilt.FeatureFlags.Abstraction" Version="1.0.1" />
Step 3: Register in your module's Startup
public override void ConfigureServices(IServiceCollection services)
{
services.AddFeatureFlagHelper();
}
Usage
In a service
public class MyService(IFeatureFlagHelper featureFlags)
{
public async Task DoWorkAsync()
{
if (await featureFlags.IsEnabledAsync(f => f.IsAdvancedSearch))
{
// feature is enabled for this tenant
}
}
}
In a controller
public class MyController(IFeatureFlagHelper featureFlags) : Controller
{
public async Task<IActionResult> Index()
{
if (!await featureFlags.IsEnabledAsync(f => f.IsBetaDashboard))
return NotFound();
return View();
}
}
In a Razor view
@inject IFeatureFlagHelper FeatureFlags
@if (await FeatureFlags.IsEnabledAsync(f => f.IsMaintenanceBanner))
{
<div class="alert alert-warning">Scheduled maintenance tonight.</div>
}
Read all flags at once
var settings = await featureFlags.GetAsync();
if (settings.IsDarkMode) { ... }
if (settings.IsWorkflowAutomation) { ... }
API
| Member | Returns | Description |
|---|---|---|
GetAsync() |
Task<FeatureFlagSetting> |
Returns the full settings object for the current tenant |
IsEnabledAsync(f => f.IsXxx) |
Task<bool> |
Returns true if the selected flag is enabled |
Security notes
- Flag reads are tenant-scoped automatically via Orchard Core's
ISiteService - Flags can only be toggled by users with the
ManageFeatureFlagspermission (Administrators by default) - When the
GovBuilt.FeatureFlagsmodule is disabled on a tenant, all flags returnfalse— no exceptions are thrown
Publishing
dotnet pack src/GovBuilt.Helpers/GovBuilt.FeatureFlags.Abstraction/GovBuilt.FeatureFlags.Abstraction.csproj -c Release -o ./artifacts
dotnet nuget push ./artifacts/GovBuilt.FeatureFlags.Abstraction.*.nupkg --source GovBuiltFeed --api-key az
| Product | Versions 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. |
-
net8.0
- OrchardCore.Settings (>= 2.2.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on GovBuilt.FeatureFlags.Abstraction:
| Package | Downloads |
|---|---|
|
GovBuilt.FeatureFlags
Orchard Core module that stores and manages per-tenant feature flag settings via Orchard Core's ISiteService. Provides an admin UI for toggling flags per tenant and registers IFeatureFlagHelper for consumption across GovBuilt modules. |
|
|
GovBuilt.FeatureFlags.Tenants
Orchard Core module that provides a cross-tenant admin UI for managing feature flags across all running tenants from a single page. Loads and saves settings in parallel with capped concurrency, isolates per-tenant errors, and auto-enables GovBuilt.FeatureFlags on any tenant where a flag is turned on. |
GitHub repositories
This package is not used by any popular GitHub repositories.