Skip to content
FeatureSwitch is library that should reduce amount of time and code required to implement feature switching in your projects.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget Removed Nuget source Nov 25, 2017
.vs Close #29 Dec 28, 2017
EpiSample Upgraded to CMS 11. Close #28 Nov 25, 2017
FeatureSwitch.AspNet.Mvc Added local and remote request features. This closes #11 Jan 9, 2015
FeatureSwitch.AspNet.Mvc5 Upgraded to CMS 11. Close #28 Nov 25, 2017
FeatureSwitch.AspNet.Sample Close #29 Dec 28, 2017
FeatureSwitch.Azure Upgraded to CMS 11. Close #28 Nov 25, 2017
FeatureSwitch.EPiServer Close #29 Dec 28, 2017
FeatureSwitch.Glimpse Removed content script Jan 19, 2015
FeatureSwitch.Ninject.Tests Added empty constructor Jan 5, 2015
FeatureSwitch.Ninject Fixed some namings, references and copyright Jan 10, 2015
FeatureSwitch.StructureMap.2.6 Updated packages to new version. This closes #6. Dec 3, 2014
FeatureSwitch.StructureMap.Tests Close #29 Dec 28, 2017
FeatureSwitch.StructureMap Close #29 Dec 28, 2017
FeatureSwitch.Unity.Tests Updated packages to new version. This closes #6. Dec 3, 2014
FeatureSwitch.Unity Updated packages to new version. This closes #6. Dec 3, 2014
FeatureSwitch.Web.Optimization Added non-generic overloads for scripts and styles renderer. This closes Oct 21, 2015
FeatureSwitch Upgraded to CMS 11. Close #28 Nov 25, 2017
FeatureSwitchTests Close #29 Dec 28, 2017
packages Added support for Ninject IoC Jan 5, 2015
.gitattributes Initial commit Dec 18, 2013
.gitignore Removed StructureMap dependnecy. This closes #4 May 22, 2014
.whitesource Initial WhiteSource configuration file Jun 25, 2019
CommonAssemblyInfo.cs Upgraded to CMS 11. Close #28 Nov 25, 2017
CommonAssemblyInfo.cs.ide Fixed bug when UI accessed via controller name Jan 5, 2014
FeatureSwitch.sln Upgraded to CMS 11. Close #28 Nov 25, 2017
LICENSE Upgraded to CMS 11. Close #28 Nov 25, 2017
README.md Update README.md Nov 26, 2016
Verify.ruleset Added Verify solution configuration Jan 5, 2014
appveyor.yml Upgraded to CMS 11. Close #28 Nov 25, 2017
build-packages.ps1 Upgraded to CMS 11. Close #28 Nov 25, 2017
nuget.config Upgraded to CMS 11. Close #28 Nov 25, 2017

README.md

Build status

Feature Switch

Feature Toggling Framework for Various Types of Applications

Have you ever wrote the code like following to verify that either you have to disable or enable some functionality base on set of conditions (usually different sources):

  if(ConfigurationManager.AppSettings["MyKey"] == "true")
      return ...;

or something like this:

  if(HttpContext.Current != null && HttpContext.Current.Session != null && HttpContext.Current.Session["MyKey"] == "true")
      return ...;

FeatureSwitch library should reduce amount of time and code needed to implement feature toggle in unified way. FeatureSwitch library is easily adoptable and extendable.

Overview

FeatureSwitch library is based on two basic aspects features and strategies. In combination they provide enough input data for feature set builder to construct feature context to be used later to check whether particular feature is enabled or disabled. Currently there are following additional integrations:

Features

Feature is main aspect of FeatureSwitch library it's your logical feature representation - either it's enabled or disabled. You will need to define your features to work with FeatureSwitch library. To define your feature you have to create class that inherits from FeatureSwitch.BaseFeature class:

  public class MySampleFeature : FeatureSwitch.BaseFeature
  {
  }

Keep in mind that you will need to add at least one strategy for the feature in order to enable it. By default every feature is disabled.

Setup (FeatureSet builder)

To get started with FeatureSwitch you need to kick-off FeatureSetBuilder by calling Build() instance method:

  var builder = new FeatureSetBuilder();
  builder.Build();

By calling Build method you are triggering auto-discovery of features in current application domain loaded assemblies. Auto-discovery will look for classes inheriting from FeatureSwitch.BaseFeature class. Those are assumed to be features.

Is Feature Enabled?

After features have been discovered and set has been built you are able to check whether feature is enabled or not:

  var isEnabled = FeatureContext.IsEnabled<MySampleFeature>();

You can also use some of the IsEnabled overloads for other usages.

Where do I get packages?

All packages are available on NuGet feeds:

More Information

More information on extending FeatureSwitch library.

You can’t perform that action at this time.