'If I'm making a filter in an ASP.NET Core application, should I also inherit IFilterMetadata?

I've made an authorize filter (by inheriting the new IAsyncAuthorizationFilter), should I also inherit IFilterMetadata, and why/why not?

Thank you.



Solution 1:[1]

no IAsyncAuthorizationFilter already inherits IFilterMetadata

public interface IAsyncAuthorizationFilter : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata

as MSDN indicates IFilterMetadata is a "marker" interface to indicate filter types to MVC. For an example have a look at the source of FilterCollection.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bamdad