예제 #1
0
 public static void RegisterComponents()
 {
     UsingUnityContainer.Init();
     DependencyRegisterType.Container(ref UsingUnityContainer._container);
     DependencyRegisterType.ContainerPartial(ref UsingUnityContainer._container);
     DependencyResolver.SetResolver(new UnityDependencyResolver(UsingUnityContainer._container));
 }
예제 #2
0
 public static void RegisterComponents()
 {
     UsingUnityContainer.Init();
     DependencyRegisterType.Container_Sys(ref UsingUnityContainer._container);
     DependencyRegisterType.Container_Mis(ref UsingUnityContainer._container);
     DependencyRegisterType.Container_Def(ref UsingUnityContainer._container);
     DependencyRegisterType.Container_Flow(ref UsingUnityContainer._container);
     DependencyRegisterType.Container_Sql(ref UsingUnityContainer._container);
     DependencyRegisterType.Container_WC(ref UsingUnityContainer._container);
     DependencyResolver.SetResolver(new UnityDependencyResolver(UsingUnityContainer._container));
 }
예제 #3
0
        public static void RegisterComponentsByWebApi()
        {
            // register all your components with the container here
            // it is NOT necessary to register your controllers

            // e.g. container.RegisterType<ITestService, TestService>();
            //×¢Èë Ioc
            // var container = new UnityContainer();
            UsingUnityContainer.Init();
            DependencyRegisterType.Container(ref UsingUnityContainer._container);
            DependencyRegisterType.ContainerPartial(ref UsingUnityContainer._container);
            GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(UsingUnityContainer._container);
        }