Created
October 15, 2010 07:52
-
-
Save jglozano/627801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fluent Filters | |
public class MyGlobalFilters : GlobalFilterRegistry { | |
public MyGlobalFilters() { | |
AsGlobal<GlobalFilter>(); | |
} | |
} | |
public class HomeFilters : ControllerFilterRegistry<HomeController> { | |
public HomeFilters() { | |
// Set a Controller wide filter | |
With<HomeFilter>() | |
// Set an filter to an specific action | |
.ForAction<HomeActionFilter>(c => c.Index(null, null)); | |
} | |
} | |
// Fluent Binders | |
public class FooBinders: ModelBinderRegistry { | |
public FooBinders: () { | |
Bind<Foo, FooBinder>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment