protected override void AddServerErrorHandlers(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) { int errorHandlerCount = endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.Count; base.AddServerErrorHandlers(endpoint, endpointDispatcher); IErrorHandler baseHandler = endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers[errorHandlerCount]; endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.RemoveAt(errorHandlerCount); JsonValueAwareValidationErrorHandler newHandler = new JsonValueAwareValidationErrorHandler(baseHandler); endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.Add(newHandler); }
protected override void AddServerErrorHandlers(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) { int errorHandlerCount = endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.Count; base.AddServerErrorHandlers(endpoint, endpointDispatcher); IErrorHandler baseHandler = endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers[errorHandlerCount]; endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.RemoveAt(errorHandlerCount); JsonValueAwareValidationErrorHandler newHandler = new JsonValueAwareValidationErrorHandler(baseHandler); endpointDispatcher.DispatchRuntime.ChannelDispatcher.ErrorHandlers.Add(newHandler); }