Created
February 7, 2012 03:26
kitchen sink Action Filter
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
[MyCustomControllerAttribute1] | |
[MyCustomControllerAttribute2] | |
public class HomeController : Controller | |
{ | |
public ActionExecutingContext FilterContext; | |
[KitchenSinkActionExecutingFilter] | |
[MyCustomActionAttribute1] | |
[MyCustomActionAttribute2] | |
public ActionResult Index(string id, string anotherParam) | |
{ | |
return View(FilterContext); | |
} | |
} | |
public class KitchenSinkActionExecutingFilterAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
(filterContext.Controller as HomeController).FilterContext = filterContext; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment