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