Пример #1
0
        public static void InitializeNhibernate()
        {
            //ISSession factory
            var configFile      = HostingEnvironment.MapPath("~/" + AppSetting.NhibernateConfig);
            var mappingAssembly = typeof(Vienauto.Entity.Maps.ManufacturerMap).Assembly;

            NhibernateConfiguration.Init(configFile, mappingAssembly);
        }
Пример #2
0
 public BootController(NhibernateConfiguration config)
 {
     _config = config;
 }
Пример #3
0
        protected override ISession OpenSession(string factoryKey = "")
        {
            var sessionFactory = NhibernateConfiguration.GetSessionFactory(factoryKey);

            return(sessionFactory.OpenSession());
        }
Пример #4
0
        protected override ISession OpenDefaultSession()
        {
            var sessionFactory = NhibernateConfiguration.GetDefaultSessionFactory();

            return(sessionFactory.OpenSession());
        }