Configurable Action Filter Provider
Posted by: K. Scott Allen,
on 19 Jan 2011 |
View original | Bookmarked: 0 time(s)
In MVC 3 you can implement an IFilterProvider to create and feed action filters to the MVC runtime. Assuming you have the configuration classes in place from the last post, you can create a custom filter provider to add action filters to the MVC pipeline. public class ConfiguredFilterProvider : IFilterProvider
{
public IEnumerable<Filter> GetFilters(
ControllerContext controllerContext,
ActionDescriptor actionDescriptor)
{
var filters = FiltersSettings.Settings.Filters;
...