public static void AddSessionFactoryConfiguration(string key, SessionProvider configuration) { if (SessionFactories == null) { SessionFactories = new Dictionary <string, SessionProvider>(); } if (!SessionFactories.ContainsKey(key)) { SessionFactories.Add(key, configuration); } }
public void InitDataContext(string connectionString, List <Assembly> dataMappings) { if (String.IsNullOrWhiteSpace(RepositoryKey)) { RepositoryKey = connectionString; } var config = new SessionProvider(dataMappings); config.Initialize(connectionString); NHibernateSessionProvider.AddSessionFactoryConfiguration(RepositoryKey, config); #if DEBUG NHibernateProfiler.Initialize(); #endif }