I have registered my actionfilter globally
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new MyNewCustomActionFilter());
}
now i need to skip this filter in some methods, the behavior i want is like [AllowAnonymous] how to do it?
You need to do this in two parts. First, implement your attribute class with which you will decorate the method that you wish to exclude.
Then, in the
ExecuteActionFilterAsyncmethod of your IActionFilter implementation, check if the action being invoked is decorated with this method.