public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 {
     IInstanceProvider provider = new WcfIocContainer(serviceDescription.ServiceType);
     foreach (ChannelDispatcher dispatcher in serviceHostBase.ChannelDispatchers)
     {
         foreach (var endpoint in dispatcher.Endpoints)
         {
             var dispatcherRuntime = endpoint.DispatchRuntime;
             dispatcherRuntime.InstanceProvider = provider;
         }
     }
 }
示例#2
0
        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        {
            IInstanceProvider provider = new WcfIocContainer(serviceDescription.ServiceType);

            foreach (ChannelDispatcher dispatcher in serviceHostBase.ChannelDispatchers)
            {
                foreach (var endpoint in dispatcher.Endpoints)
                {
                    var dispatcherRuntime = endpoint.DispatchRuntime;
                    dispatcherRuntime.InstanceProvider = provider;
                }
            }
        }