Example #1
0
 public void OnActionExecuted(ActionExecutedContext context)
 {
     if (context.Exception is TravelPlannerException exception)
     {
         context.Result = new ObjectResult(new { exception.Message })
         {
             StatusCode = exception.StatusCode,
         };
         context.ExceptionHandled = true;
     }
 }
Example #2
0
 public override void OnActionExecuting(ActionExecutingContext context)
 {
     Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext a = null;
     var x = this as IActionFilter;
 }
Example #3
0
 public void OnActionExecuted(Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext context)
 {
     context.HttpContext.Response.Headers.Add("x-action-filter", "action");
 }
Example #4
0
 public void OnActionExecuted(Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext filterContext)
 {
 }