예제 #1
0
        public override bool Evaluate(NodeElement conditionNode)
        {
            var featureName = conditionNode.GetAttribute("name");

            if (String.IsNullOrEmpty(featureName))
            {
                return(true);
            }

            return(FeatureSwitchService.IsFeatureEnabled(featureName) ?? true);
        }
예제 #2
0
        public override bool Evaluate(NodeElement conditionNode)
        {
            var featureName = conditionNode.GetAttribute("name");

            if (String.IsNullOrEmpty(featureName))
            {
                return(true);
            }

            bool enabledByDefault = true;

            if (bool.TryParse(conditionNode.GetAttribute("optIn"), out bool optIn))
            {
                enabledByDefault = !optIn;
            }

            return(FeatureSwitchService.IsFeatureEnabled(featureName) ?? enabledByDefault);
        }