public CustomCreatorServiceHost(Func<object> instanceCreator, Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        {
            if (instanceCreator == null)
            {
                throw new ArgumentNullException("instanceCreator");
            }

            var contracts = ImplementedContracts.Values;
            foreach (var c in contracts)
            {
                var instanceProvider = new CustomCreatorInstanceProvider(instanceCreator);
                c.Behaviors.Add(instanceProvider);
            }
        }
Exemplo n.º 2
0
        public CustomCreatorServiceHost(Func <object> instanceCreator, Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        {
            if (instanceCreator == null)
            {
                throw new ArgumentNullException("instanceCreator");
            }

            var contracts = ImplementedContracts.Values;

            foreach (var c in contracts)
            {
                var instanceProvider = new CustomCreatorInstanceProvider(instanceCreator);
                c.Behaviors.Add(instanceProvider);
            }
        }