コード例 #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));
 }