FilterCollectionExtensions.AddForFeature<TFilterType> Method
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.
Adds an MVC filter that will only activate during a request if the specified feature is enabled.
public static Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata AddForFeature<TFilterType> (this Microsoft.AspNetCore.Mvc.Filters.FilterCollection filters, string feature) where TFilterType : Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter;
static member AddForFeature : Microsoft.AspNetCore.Mvc.Filters.FilterCollection * string -> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata (requires 'FilterType :> Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter)
<Extension()>
Public Function AddForFeature(Of TFilterType As IAsyncActionFilter) (filters As FilterCollection, feature As String) As IFilterMetadata
Type Parameters
- TFilterType
The MVC filter to add and use if the feature is enabled.
Parameters
- filters
- FilterCollection
The filter collection to add to.
- feature
- String
The feature that will need to enabled to trigger the execution of the MVC filter.
Returns
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Azure SDK for .NET