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

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 IFeatureFlagHelper for 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-false defaults when the GovBuilt.FeatureFlags module 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.FeatureFlags module 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 ManageFeatureFlags permission (Administrators by default)
  • When the GovBuilt.FeatureFlags module is disabled on a tenant, all flags return false — 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 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 (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.

Version Downloads Last Updated
1.0.4 1,295 4/21/2026
1.0.3 136 4/16/2026
1.0.2 112 4/16/2026
1.0.1 118 4/14/2026
1.0.0 114 4/14/2026