The msdn information is not entirely clear, but IOverrideFilter.FiltersToOverride should be exactly one of the following
IActionFilterIAuthorizationFilterIAuthenticationFilterIExceptionFilter
Basically, you cannot redefine certain filters, you can only redefine all filters of one of the above categories. See the ProcessOverrideFilters method in the source code .
So, let's say that your ITest filter is of type IActionFilter , then your redefinition will be (the same logic applies to any other category of filters):
public Type FiltersToOverride { get { return typeof(IActionFilter); } }
You can also use the predefined OverrideActionFilters (and similar predefined override attributes for other filter categories).
For a smaller-scale redefinition, you may need to develop specific solutions like this one or write your own filter provider as in this very good article
source share