Пример #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();
 }