public static async Task EnsureFeatureAsync(this IFeatureGate gate, string name) { if (!await gate.IsFeatureEnabledAsync(name)) { throw new AccessDeniedException($"Feature {name} is disabled"); } }
public static async Task <bool> IsFeatureEnabledAsync(this IFeatureGate gate, string name) { return(await gate.IsFeatureEnabledAsync(name)); }