private IEnumerable <string> GetChains(DelegatingHandler handler) { yield return(handler.GetType().FullName); var innerHander = handler.InnerHandler as DelegatingHandler; if (innerHander != null) { yield return(innerHander.GetType().FullName); } }
void PrintMessageHandlerChain(DelegatingHandler handler) { System.Web.HttpContext.Current.Response.Write(handler.GetType().Name); while (null != handler.InnerHandler) { _bu.Append(" => " + handler.InnerHandler.GetType().Name); handler = handler.InnerHandler as DelegatingHandler; if (null == handler) { break; } } _bu.Append("<br/>"); }
private IEnumerable <string> GetHandleChain(DelegatingHandler handler) { yield return(handler.GetType().Name); while (handler.InnerHandler != null) { yield return(handler.InnerHandler.GetType().Name); handler = handler.InnerHandler as DelegatingHandler; if (handler == null) { break; } } }
protected override Task <HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { return(_traceWriter.TraceBeginEndAsync <HttpResponseMessage>( request, TraceCategories.MessageHandlersCategory, TraceLevel.Info, _innerHandler.GetType().Name, SendAsyncMethodName, beginTrace: null, execute: () => base.SendAsync(request, cancellationToken), endTrace: (tr, response) => { if (response != null) { tr.Status = response.StatusCode; } }, errorTrace: null)); }