示例#1
0
 private static void RegisterDatabaseDriver(this ContainerImpl container, Type driverType)
 {
     container.WindsorContainer.Register(
         Component.For(typeof(DbDriver))
         .Named(driverType.FullName)
         .ImplementedBy(driverType)
         .LifestyleSingleton()
         );
 }
示例#2
0
        /// <summary>
        /// Creates the default service collection.
        /// </summary>
        /// <returns></returns>
        public static IContainer CreateDefaultContainer(bool initialize = true)
        {
            var wrapper = new ContainerImpl(new WindsorContainer());

            if (initialize)
            {
                ContainerInitializer.InitializeDefaultServices(wrapper);
            }

            return(wrapper);
        }