public FangHost() { CacheManagerContainer cacheManagerContainer = new CacheManagerContainer(); string databaseConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NH.config"); this.DataProviderFactory = new DataProviderFactory(cacheManagerContainer, databaseConfigPath); }
public DataProviderFactory(CacheManagerContainer cacheManagerContainer, string databaseConfigPath) { if (string.IsNullOrEmpty(databaseConfigPath)) { throw new ArgumentNullException("databaseConfigPath"); } Configuration config = new NHibernate.Cfg.Configuration().Configure(databaseConfigPath); this.SessionFactory = config.BuildSessionFactory(); this.CacheManagerContainer = cacheManagerContainer; this.DataProviders = new List <IDataProvider>(); this.DataProviderTypes = ReflectionHelper.GetSubclass <IDataProvider>(this.GetType().Assembly); this.OpenNhibernateSessionInfoList = new ReaderWriterLockedList <OpenNhibernateSessionInfo>(); }