protected virtual bool IsFeatureCheckDisabled(MethodInvocationFeatureCheckerContext context) { return(context.Method .GetCustomAttributes(true) .OfType <DisableFeatureCheckAttribute> () .Any()); }
public async Task CheckAsync(MethodInvocationFeatureCheckerContext context) { if (IsFeatureCheckDisabled(context)) { return; } foreach (var requiresFeatureAttribute in GetRequiredFeatureAttributes(context.Method)) { await _featureChecker.CheckEnabledAsync(requiresFeatureAttribute.RequiresAll, requiresFeatureAttribute.Features); } }