Context. Is Effective Policy<TMetadata>(TMetadata) Method
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.
public: generic <typename TMetadata> where TMetadata : Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata bool IsEffectivePolicy(TMetadata policy);
public bool IsEffectivePolicy<TMetadata> (TMetadata policy) where TMetadata : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata;
member this.IsEffectivePolicy : 'Metadata -> bool (requires 'Metadata :> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata)
Public Function IsEffectivePolicy(Of TMetadata As IFilterMetadata) (policy As TMetadata) As Boolean
The type of the filter policy.
The filter policy instance.
true if the provided IFilterMetadata is the most effective policy, otherwise
The IsEffectivePolicy<TMetadata>(TMetadata) method is used to implement a common convention for filters that define an overriding behavior. When multiple filters may apply to the same cross-cutting concern, define a common interface for the filters (
TMetadata) and implement the filters such that all of the implementations call this method to determine if they should take action.
For instance, a global filter might be overridden by placing a filter attribute on an action method. The policy applied directly to the action method could be considered more specific.
This mechanism for overriding relies on the rules of order and scope that the filter system provides to control ordering of filters. It is up to the implementor of filters to implement this protocol cooperatively. The filter system has no innate notion of overrides, this is a recommended convention.