示例#1
0
 public void AutoCriarBancoDeDados()
 {
     var sessionFactoryProvider = new SessionFactoryProvider();
     var sessionProvider = new SessionProvider(sessionFactoryProvider);
     sessionProvider.GetCurrentSession();
     sessionFactoryProvider.AutoCriarBancoDeDados();
 }
示例#2
0
        public static WindsorContainer InicializarContainer()
        {
            //if (_container == null)
            //{
                _container = new WindsorContainer();
                _container.Register(Component.For<IBancoDadosCreator>().ImplementedBy<BancoDadosCreator>());
                _container.Register(Component.For<IAdministradorServico>().ImplementedBy<AdministradorServico>());
                _container.Register(Component.For<IAutorRepositorio>().ImplementedBy<AutorRepositorio>());
                _container.Register(Component.For<ILivroRepositorio>().ImplementedBy<LivroRepositorio>());
                _container.Register(Component.For<IEstanteRepositorio>().ImplementedBy<EstanteRepositorio>());
                _container.Register(Component.For<IPrateleiraRepositorio>().ImplementedBy<PrateleiraRepositorio>());

                var sessionFactoryProvider = new SessionFactoryProvider();
                _container.Register(Component.For<SessionProvider>().LifeStyle.Singleton.Instance(new SessionProvider(sessionFactoryProvider)));
            //}
            return _container;
        }