Skip to content

Instantly share code, notes, and snippets.

@cdvillard
Created February 28, 2016 14:10
Show Gist options
  • Save cdvillard/ea1f42e2a5a4e625f694 to your computer and use it in GitHub Desktop.
Save cdvillard/ea1f42e2a5a4e625f694 to your computer and use it in GitHub Desktop.
Simple Custom Action Filter
public class SimpleActionFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
Debug.WriteLIne("This Event Fired: OnActionExecuting");
}
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
Debug.WriteLine("This Event Fired: OnActionExecuted");
}
public override void OnResultExecuting(ResultExecutingContext filterContext)
{
Debug.WriteLine("This Event Fired: OnResultExecuting");
}
public override void OnResultExecuted(ResultExecutedContext filterContext)
{
Debug.WriteLine("This Event Fired: OnResultExecuted");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment