Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General

Feature flags allow display and hide new and old features implemented inside a system.

Existing Feature flags

WLM Demo Portal have two flag implemented for the moment:

  1. Default Activities - appsetting.json/AddDefaultActivitiesAndTimes

  2. Session Expiry popup - appsetting.json/DisplaySessionExpiryPopup

The flags are just true/false values to switch a corresponding feature on and off.

It is important so the flags will be part of configuration file and not hardcoded inside the code. In such a way we always can update the flag without recompiling the code.

Usage inside WLM Demo Portal

Whenever we need a flag to be used, we have to read it from configuration settings. Usually is it done inside a constructor or inside OnInitializeAsync() method

Example:

Code Block
languagec#
DisplaySessionExpiryPopup = _configuration.GetValue<bool>("DisplaySessionExpiryPopup");

From this moment the variable can be used as a condition:

Code Block
languagec#
if (DisplaySessionExpiryPopup)
  {
      //some code here
  }