你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

FeatureGateAttribute 类

定义

一个属性,可以放置在 MVC 控制器、控制器操作或 Razor 页面上,以要求启用所有或任意一组功能标志。

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)]
public class FeatureGateAttribute : Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute, Microsoft.AspNetCore.Mvc.Filters.IAsyncPageFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)>]
type FeatureGateAttribute = class
    inherit ActionFilterAttribute
    interface IAsyncPageFilter
    interface IFilterMetadata
Public Class FeatureGateAttribute
Inherits ActionFilterAttribute
Implements IAsyncPageFilter
继承
FeatureGateAttribute
属性
实现

构造函数

FeatureGateAttribute(Object[])

创建一个属性,该属性将限制操作或页面,除非启用) (提供的所有功能标志。

FeatureGateAttribute(RequirementType, Object[])

创建可用于限制操作或页面的属性。 可以将门配置为要求 () 传递所有或任何提供的功能标志。

FeatureGateAttribute(RequirementType, String[])

创建可用于限制操作或页面的属性。 可以将门配置为要求 () 传递所有或任何提供的功能标志。

FeatureGateAttribute(String[])

创建一个属性,该属性将限制操作或页面,除非启用) (提供的所有功能标志。

属性

FeatureFlags

功能门属性将为其激活的功能标志的名称。

Features

功能属性将为其激活的功能的名称。

RequirementType

控制是否应启用 中的 FeatureFlags 任意或所有功能标志以传递。

方法

OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)

执行控制器操作预处理,以确保至少启用一个指定的功能标志。

OnPageHandlerExecutionAsync(PageHandlerExecutingContext, PageHandlerExecutionDelegate)

在调用处理程序方法之前,在模型绑定完成后异步调用。

OnPageHandlerSelectionAsync(PageHandlerSelectedContext)

在选择处理程序方法之后,但在模型绑定发生之前异步调用。

适用于