Skip to content

Instantly share code, notes, and snippets.

@jglozano jglozano/Fluent.cs
Created Oct 15, 2010

Embed
What would you like to do?
// 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
You can’t perform that action at this time.