Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanliang-ms committed Dec 4, 2024
1 parent 2f1fa6a commit 6fad902
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/RazorPages/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace RazorPages.Pages
{
[FeatureGate(requirementType: RequirementType.All, negate: true, "Home")]
[FeatureGate(requirementType: RequirementType.Any, negate: false, ["Home"])]
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext contex
? await Features.All(async feature => await fm.IsEnabledAsync(feature).ConfigureAwait(false))
: await Features.Any(async feature => await fm.IsEnabledAsync(feature).ConfigureAwait(false));

if (Negate)
{
enabled = !enabled;
}

if (enabled)
{
await next.Invoke().ConfigureAwait(false);
Expand Down

0 comments on commit 6fad902

Please sign in to comment.