Exemplo n.º 1
0
        /// <inheritdoc cref="EvaluateAsync(FeatureFilterEvaluationContext{TFeature}, TContext)" />
        public async Task <bool> EvaluateAsync(FeatureFilterEvaluationContext context, TContext appContext)
        {
            if (_featureEnumParser.TryParse(context.FeatureName, true, out TFeature feature))
            {
                return(await EvaluateAsync(new FeatureFilterEvaluationContext <TFeature>
                {
                    Feature = feature,
                    Parameters = context.Parameters
                }, appContext).ConfigureAwait(false));
            }

            return(false);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Evaluates the feature filter to see if the filter's criteria for being enabled has been satisfied.
 /// </summary>
 /// <param name="context">
 /// A feature filter evaluation context that contains information that may be needed to evalute the filter. This
 /// context includes configuration, if any, for this filter for the feature being evaluated.
 /// </param>
 /// <param name="appContext">
 /// A context defined by the application that is passed in to the feature management system to provide
 /// contextual information for evaluating a feature's state.
 /// </param>
 /// <returns><c>true</c> if the filter's criteria has been met; otherwise, <c>false</c>.</returns>
 public abstract Task <bool> EvaluateAsync(FeatureFilterEvaluationContext <TFeature> context, TContext appContext);