Example #1
0
        HttpActionDescriptor IHttpActionSelector.SelectAction(HttpControllerContext controllerContext)
        {
            HttpActionDescriptor actionDescriptor = null;

            _traceWriter.TraceBeginEnd(
                controllerContext.Request,
                TraceCategories.ActionCategory,
                TraceLevel.Info,
                _innerSelector.GetType().Name,
                SelectActionMethodName,
                beginTrace: null,
                execute: () => { actionDescriptor = _innerSelector.SelectAction(controllerContext); },
                endTrace: (tr) =>
            {
                tr.Message = Error.Format(
                    SRResources.TraceActionSelectedMessage,
                    FormattingUtilities.ActionDescriptorToString(actionDescriptor));
            },

                errorTrace: null);

            // Intercept returned HttpActionDescriptor with a tracing version
            return(actionDescriptor == null ? null : new HttpActionDescriptorTracer(controllerContext, actionDescriptor, _traceWriter));
        }