/// <summary>
        /// 初始化依赖注入容器
        /// </summary>
        static void InitContainer()
        {
            if (!ResolveMediator.ContainerBuilt)
            {
                ContainerBuilder builder = ResolveMediator.GetContainerBuilder();
                builder.RegisterConfigs();

                ResolveMediator.Build();
            }
        }
Example #2
0
 /// <summary>
 /// 配置应用程序
 /// </summary>
 protected override void Configure()
 {
     //初始化依赖注入容器
     if (!ResolveMediator.ContainerBuilt)
     {
         ContainerBuilder containerBuilder = ResolveMediator.GetContainerBuilder();
         containerBuilder.RegisterConfigs();
         ResolveMediator.Build();
     }
 }
Example #3
0
        public void Init()
        {
            if (!ResolveMediator.ContainerBuilt)
            {
                ContainerBuilder builder = ResolveMediator.GetContainerBuilder();
                builder.RegisterType(typeof(ProductContract)).As(typeof(IProductContract));

                ResolveMediator.Build();
            }
        }