Merge pull request #249 from pcc/xgetinputfocus
[mono.git] / mcs / class / System.Web.Mvc3 / Mvc / ControllerInstanceFilterProvider.cs
1 namespace System.Web.Mvc {
2     using System.Collections.Generic;
3
4     public class ControllerInstanceFilterProvider : IFilterProvider {
5         public IEnumerable<Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor) {
6             if (controllerContext.Controller != null) {
7                 // Use FilterScope.First and Order of Int32.MinValue to ensure controller instance methods always run first
8                 yield return new Filter(controllerContext.Controller, FilterScope.First, Int32.MinValue);
9             }
10         }
11     }
12 }