Пример #1
0
 static BaseRepository()
 {
     try
     {
         if (_dbConnection == null)
         {
             _dbConnection = new MySqlConnection(CoreConfig.GetConnectionString("SqlConnection"));
             if (_dbConnection.State == ConnectionState.Closed)
             {
                 _dbConnection.Open();
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Пример #2
0
        public BaseService(IUserIdentity identity, string connName)
        {
            var connStr = CoreConfig.GetConnectionString(connName);

            sqlExecutor = SqlExecutor.CreateOracleExecutor(connStr, identity, false, ConfigurationManager.AppSettings.Get("AllowAnanimus") == "true");
        }