/// <summary> /// Initializes a new instance of the <see cref="ServiceLocatorServiceHost"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="serviceConcrete">Type of the service.</param> /// <param name="baseAddresses">The base addresses.</param> public ServiceLocatorServiceHost(IParentContainer container, Type serviceConcrete, params Uri[] baseAddresses) : base(serviceConcrete, baseAddresses) { if (container == null) { throw new ArgumentNullException("container"); } ApplyServiceBehaviors(container); ApplyContractBehaviors(container); foreach (var contractDescription in ImplementedContracts.Values) { var contractBehavior = new ServiceLocationContractBehavior(new ServiceLocatorInstanceProvider(container, contractDescription. ContractType)); contractDescription.Behaviors.Add(contractBehavior); } }