Exemple #1
0
        private static IReportingModuleSessionFactory GetSessionFactory()
        {
            var sessionFactory = NsbSqlDatabase.Configure(
                WebSchemaConfigurationUtility.ReportingModuleConnectionString,
                WebSchemaConfigurationUtility.ReportingModuleSchema,
                new Assembly[0],
                FluentMappedAssemblies);

            return(new ReportingModuleSessionFactory(sessionFactory));
        }
        public NHibernateRegistry(
            string connectionString,
            string schema,
            Assembly[] hbmAssemblies,
            Assembly[] fluentAssemblies)
        {
            ForSingletonOf <ISessionFactory>().Use(NsbSqlDatabase.Configure(
                                                       connectionString,
                                                       schema,
                                                       hbmAssemblies,
                                                       fluentAssemblies));

            For <ISession>().Use(ctx => ctx.GetInstance <ISessionFactory>().OpenSession());
        }