FeatureGateAttribute Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An attribute that can be placed on MVC controllers, controller actions, or Razor pages to require all or any of a set of features to be enabled.
[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
- Inheritance
-
FeatureGateAttribute
- Attributes
- Implements
Constructors
| Name | Description |
|---|---|
| FeatureGateAttribute(Boolean, Object[]) |
Creates an attribute that can be used to gate actions or pages. The gate can be configured to negate the evaluation result. |
| FeatureGateAttribute(Boolean, String[]) |
Creates an attribute that can be used to gate actions or pages. The gate can be configured to negate the evaluation result. |
| FeatureGateAttribute(Object[]) |
Creates an attribute that will gate actions or pages unless all the provided feature(s) are enabled. |
| FeatureGateAttribute(RequirementType, Boolean, Object[]) |
Creates an attribute that can be used to gate actions or pages. The gate can be configured to require all or any of the provided feature(s) to pass or negate the evaluation result. |
| FeatureGateAttribute(RequirementType, Boolean, String[]) |
Creates an attribute that can be used to gate actions or pages. The gate can be configured to require all or any of the provided feature(s) to pass or negate the evaluation result. |
| FeatureGateAttribute(RequirementType, Object[]) |
Creates an attribute that can be used to gate actions or pages. The gate can be configured to require all or any of the provided feature(s) to pass. |
| FeatureGateAttribute(RequirementType, String[]) |
Creates an attribute that can be used to gate actions or pages. The gate can be configured to require all or any of the provided feature(s) to pass. |
| FeatureGateAttribute(String[]) |
Creates an attribute that will gate actions or pages unless all the provided feature(s) are enabled. |
Properties
| Name | Description |
|---|---|
| Features |
The name of the features that the feature attribute will activate for. |
| Negate |
Negates the evaluation for whether or not a feature gate should activate. |
| RequirementType |
Controls whether any or all features in Features should be enabled to pass. |
Methods
| Name | Description |
|---|---|
| OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate) |
Performs controller action pre-processing to ensure that any or all of the specified features are enabled. |
| OnPageHandlerExecutionAsync(PageHandlerExecutingContext, PageHandlerExecutionDelegate) |
Called asynchronously before the handler method is invoked, after model binding is complete. |
| OnPageHandlerSelectionAsync(PageHandlerSelectedContext) |
Called asynchronously after the handler method has been selected, but before model binding occurs. |