Exemplo n.º 1
0
 private static void RegisterDatabaseDriver(this ContainerImpl container, Type driverType)
 {
     container.WindsorContainer.Register(
         Component.For(typeof(DbDriver))
         .Named(driverType.FullName)
         .ImplementedBy(driverType)
         .LifestyleSingleton()
         );
 }
Exemplo n.º 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);
        }