Since it doesn't appear to be supported natively, what's the recommended way of implementing global filters on a per-area basis?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could use a custom IFilterProvider.
回答2:
The reason it's not supported natively is because we want to discourage developers from doing it. Areas are not associated with controllers; they're associated with routes. We wanted to discourage developers from trying to apply authorization or other security-sensitive filters to areas since they can be bypassed.
See How can we set authorization for a whole area in ASP.NET MVC? for more information.