Esempio n. 1
0
        public static ISessionFactory GetSessionFactoryInstance(ConnectionStringEnum connectionString)
        {
            ISessionFactory sessionFactory = null;

            if (_factories == null)
            {
                _factories = new ListDictionary();
            }

            if (_factories.Contains(connectionString))
            {
                sessionFactory = (ISessionFactory)_factories[connectionString];
            }
            else
            {
                var connectionStringKey = EnumHelper <ConnectionStringEnum> .GetDisplayValue(connectionString);

                sessionFactory = CreateSessionFactory(connectionStringKey);
                _factories.Add(connectionString, sessionFactory);
            }

            sessionFactory = (ISessionFactory)_factories[connectionString];

            return(sessionFactory);
        }
Esempio n. 2
0
 public void Init(ConnectionStringEnum connectionStringEnum)
 {
     this.ConnectionString = EnumString.GetStringValue(connectionStringEnum);
     this.commandWorker    = new CommandWorker("MysqlOpenHelper");
     this.commandWorker.Start();
 }