コード例 #1
0
 protected virtual bool IsFeatureCheckDisabled(MethodInvocationFeatureCheckerContext context)
 {
     return(context.Method
            .GetCustomAttributes(true)
            .OfType <DisableFeatureCheckAttribute> ()
            .Any());
 }
コード例 #2
0
        public async Task CheckAsync(MethodInvocationFeatureCheckerContext context)
        {
            if (IsFeatureCheckDisabled(context))
            {
                return;
            }

            foreach (var requiresFeatureAttribute in GetRequiredFeatureAttributes(context.Method))
            {
                await _featureChecker.CheckEnabledAsync(requiresFeatureAttribute.RequiresAll, requiresFeatureAttribute.Features);
            }
        }