public Task <HttpResponseMessage> ExecuteActionFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func <Task <HttpResponseMessage> > continuation) { var route = actionContext.RequestContext.RouteData.Route; var capturedAction = new CapturedAction { RouteTemplate = route.RouteTemplate }; var owinContext = actionContext.Request.GetOwinContext(); owinContext.SetCapturedAction(capturedAction); return(continuation()); }
public static void SetCapturedAction(this IOwinContext owinContext, CapturedAction capturedAction) { owinContext.Environment[ContextKey] = capturedAction; }