private void RegisterErrorHandlerBehavior(ErrorHandlerBehavior errorHandlerBehavior, ServiceHostBase host) { if (host.Description.Behaviors.Find<ErrorHandlerBehavior>() == null) { host.Description.Behaviors.Add(errorHandlerBehavior); } }
private void RegisterErrorHandlerBehavior(ErrorHandlerBehavior errorHandlerBehavior, ServiceHostBase host) { if (host.Description.Behaviors.Find <ErrorHandlerBehavior>() == null) { host.Description.Behaviors.Add(errorHandlerBehavior); } }
public EncapsulatedHost( ServiceHost host, Type serviceContractType, object service, Binding binding, string url, bool registerErrorHandler) { this.host = host; host.AddServiceEndpoint(serviceContractType, binding, url); RegisterServiceDebugBehavior(host); RegisterDependencyServiceBehavior(service, host); if (!registerErrorHandler) { return; } errorHandlerBehavior = new ErrorHandlerBehavior(); RegisterErrorHandlerBehavior(errorHandlerBehavior, host); }