BuildContainer() 공개 정적인 메소드

Configures and builds Autofac IOC container.
public static BuildContainer ( ) : IContainer
리턴 IContainer
        public void Setup()
        {
            try
            {
                container = Bootstrapper.BuildContainer();

                svcArticleHost = new ServiceHost(typeof(ArticleService), svcArticleServiceURI);
                svcBlogHost    = new ServiceHost(typeof(BlogService), svcBlogServiceURI);

                svcArticleHost.AddDependencyInjectionBehavior <Business.Services.Contracts.IArticleService>(container);
                svcBlogHost.AddDependencyInjectionBehavior <Business.Services.Contracts.IBlogService>(container);

                svcArticleHost.Open();
                svcBlogHost.Open();
            }
            catch (Exception ex)
            {
                svcArticleHost = null;
                svcBlogHost    = null;
            }
        }
예제 #2
0
        public void Setup()
        {
            try
            {
                container = Bootstrapper.BuildContainer();

                svcProductoHost = new ServiceHost(typeof(ProductoService), svcProductoServiceURI);
                svcPedidoHost   = new ServiceHost(typeof(PedidoService), svcPedidoServiceURI);

                svcProductoHost.AddDependencyInjectionBehavior <Business.Services.Contracts.IProductoService>(container);
                svcPedidoHost.AddDependencyInjectionBehavior <Business.Services.Contracts.IPedidoService>(container);

                svcPedidoHost.Open();
                svcProductoHost.Open();
            }
            catch (Exception ex)
            {
                svcPedidoHost   = null;
                svcProductoHost = null;
            }
        }