예제 #1
0
 public void AutoCriarBancoDeDados()
 {
     var sessionFactoryProvider = new SessionFactoryProvider();
     var sessionProvider = new SessionProvider(sessionFactoryProvider);
     sessionProvider.GetCurrentSession();
     sessionFactoryProvider.AutoCriarBancoDeDados();
 }
예제 #2
0
        public void AutoCriarBancoDeDados()
        {
            var sessionFactoryProvider = new SessionFactoryProvider();
            var sessionProvider        = new SessionProvider(sessionFactoryProvider);

            sessionProvider.GetCurrentSession();
            sessionFactoryProvider.AutoCriarBancoDeDados();
        }
예제 #3
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;
        }
예제 #4
0
 public SessionProvider(SessionFactoryProvider sessionFactoryProvider)
 {
     _sessionFactory = sessionFactoryProvider.GetSessionFactory();
 }
예제 #5
0
 public SessionProvider(SessionFactoryProvider sessionFactoryProvider)
 {
     _sessionFactory = sessionFactoryProvider.GetSessionFactory();
 }