Ejemplo n.º 1
0
        protected override ServiceHost CreateServiceHost(

            Type serviceType, Uri[] baseAddresses)

        {
            UnityServiceHost serviceHost = new UnityServiceHost(serviceType, baseAddresses);

            UnityContainer container = new UnityContainer();

            container.EnableDebugDiagnostic();
            container.EnableDiagnostic();
            container.AddExtension(new Diagnostic());

            serviceHost.Container = container;


            //configure container

            UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");

            section.Configure(container);

            //section.Containers.Default.Configure(serviceHost.Container);



            return(serviceHost);
        }
        public UnityServiceHost()
            : base()

        {
            Container = new UnityContainer();
            Container.EnableDebugDiagnostic();
            Container.EnableDiagnostic();
            Container.AddExtension(new Diagnostic());
        }
        public UnityServiceHost(Type serviceType, params Uri[] baseAddresses)

            : base(serviceType, baseAddresses)

        {
            Container = new UnityContainer();
            Container.EnableDebugDiagnostic();
            Container.EnableDiagnostic();
            Container.AddExtension(new Diagnostic());
        }
Ejemplo n.º 4
0
        public UnityInstanceProvider(Type type)

        {
            ServiceType = type;

            Container = new UnityContainer();
            Container.EnableDebugDiagnostic();
            Container.EnableDiagnostic();
            Container.AddExtension(new Diagnostic());
        }