コード例 #1
0
        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());
        }
コード例 #2
0
 public static void SetCapturedAction(this IOwinContext owinContext, CapturedAction capturedAction)
 {
     owinContext.Environment[ContextKey] = capturedAction;
 }