Ejemplo n.º 1
0
 /// <summary>
 /// ExecuteCommandNonQueryAsync
 /// </summary>
 /// <param name="Transaction"></param>
 /// <param name="dbName"></param>
 /// <param name="dbCommand"></param>
 /// <returns></returns>
 /// <exception cref="DatabaseException"></exception>
 public Task <int> ExecuteCommandNonQueryAsync(IDbTransaction?Transaction, string dbName, IDbCommand dbCommand)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteCommandNonQueryAsync(GetConnectionString(dbName, true), dbCommand));
     }
     else
     {
         return(MySQLExecuter.ExecuteCommandNonQueryAsync((MySqlTransaction)Transaction, dbCommand));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// ExecuteCommandScalarAsync
 /// </summary>
 /// <param name="Transaction"></param>
 /// <param name="dbName"></param>
 /// <param name="dbCommand"></param>
 /// <param name="useMaster"></param>
 /// <returns></returns>
 /// <exception cref="DatabaseException"></exception>
 public Task <object> ExecuteCommandScalarAsync(IDbTransaction?Transaction, string dbName, IDbCommand dbCommand, bool useMaster = false)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteCommandScalarAsync(GetConnectionString(dbName, useMaster), dbCommand));
     }
     else
     {
         return(MySQLExecuter.ExecuteCommandScalarAsync((MySqlTransaction)Transaction, dbCommand));
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// ExecuteSPScalarAsync
 /// </summary>
 /// <param name="Transaction"></param>
 /// <param name="dbName"></param>
 /// <param name="spName"></param>
 /// <param name="parameters"></param>
 /// <param name="useMaster"></param>
 /// <returns></returns>
 /// <exception cref="DatabaseException"></exception>
 public Task <object> ExecuteSPScalarAsync(IDbTransaction?Transaction, string dbName, string spName, IList <IDataParameter> parameters, bool useMaster = false)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteSPScalarAsync(GetConnectionString(dbName, useMaster), spName, parameters));
     }
     else
     {
         return(MySQLExecuter.ExecuteSPScalarAsync((MySqlTransaction)Transaction, spName, parameters));
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// ExecuteSPNonQueryAsync
 /// </summary>
 /// <param name="Transaction"></param>
 /// <param name="dbName"></param>
 /// <param name="spName"></param>
 /// <param name="parameters"></param>
 /// <returns></returns>
 /// <exception cref="DatabaseException"></exception>
 public Task <int> ExecuteSPNonQueryAsync(IDbTransaction?Transaction, string dbName, string spName, IList <IDataParameter> parameters)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteSPNonQueryAsync(GetConnectionString(dbName, true), spName, parameters));
     }
     else
     {
         return(MySQLExecuter.ExecuteSPNonQueryAsync((MySqlTransaction)Transaction, spName, parameters));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 使用完毕后必须Dispose
 /// </summary>
 /// <param name="Transaction"></param>
 /// <param name="spName"></param>
 /// <param name="dbParameters"></param>
 /// <returns></returns>
 public IDataReader ExecuteSPReader(IDbTransaction Transaction, string dbName, string spName, IList <IDataParameter> dbParameters, bool useMaster)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteSPReader(GetConnectionString(dbName, useMaster), spName, dbParameters));
     }
     else
     {
         return(MySQLExecuter.ExecuteSPReader((MySqlTransaction)Transaction, spName, dbParameters));
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// ExecuteSPReaderAsync
 /// </summary>
 /// <param name="Transaction"></param>
 /// <param name="dbName"></param>
 /// <param name="spName"></param>
 /// <param name="dbParameters"></param>
 /// <param name="useMaster"></param>
 /// <returns></returns>
 /// <exception cref="DatabaseException"></exception>
 public Task <Tuple <IDbCommand, IDataReader> > ExecuteSPReaderAsync(IDbTransaction?Transaction, string dbName, string spName, IList <IDataParameter> dbParameters, bool useMaster = false)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteSPReaderAsync(GetConnectionString(dbName, useMaster), spName, dbParameters));
     }
     else
     {
         return(MySQLExecuter.ExecuteSPReaderAsync((MySqlTransaction)Transaction, spName, dbParameters));
     }
 }
Ejemplo n.º 7
0
 public object ExecuteSqlScalar(IDbTransaction Transaction, string dbName, string SQL, bool useMaster)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteSqlScalar(GetConnectionString(dbName, useMaster), SQL));
     }
     else
     {
         return(MySQLExecuter.ExecuteSqlScalar((MySqlTransaction)Transaction, SQL));
     }
 }
Ejemplo n.º 8
0
 public int ExecuteSqlNonQuery(IDbTransaction Transaction, string dbName, string SQL)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteSqlNonQuery(GetConnectionString(dbName, true), SQL));
     }
     else
     {
         return(MySQLExecuter.ExecuteSqlNonQuery((MySqlTransaction)Transaction, SQL));
     }
 }
Ejemplo n.º 9
0
 public object ExecuteCommandScalar(IDbTransaction Transaction, string dbName, IDbCommand dbCommand, bool useMaster)
 {
     if (Transaction == null)
     {
         return(MySQLExecuter.ExecuteCommandScalar(GetConnectionString(dbName, useMaster), dbCommand));
     }
     else
     {
         return(MySQLExecuter.ExecuteCommandScalar((MySqlTransaction)Transaction, dbCommand));
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// ExecuteCommandScalarAsync
        /// </summary>
        /// <param name="Transaction"></param>
        /// <param name="dbName"></param>
        /// <param name="engineCommand"></param>
        /// <param name="useMaster"></param>
        /// <returns></returns>
        /// <exception cref="DatabaseException"></exception>
        public async Task <object?> ExecuteCommandScalarAsync(IDbTransaction?Transaction, string dbName, EngineCommand engineCommand, bool useMaster = false)
        {
            using MySqlCommand command = CreateTextCommand(engineCommand);

            if (Transaction == null)
            {
                return(await MySQLExecuter.ExecuteCommandScalarAsync(GetConnectionString(dbName, useMaster), command).ConfigureAwait(false));
            }
            else
            {
                return(await MySQLExecuter.ExecuteCommandScalarAsync((MySqlTransaction)Transaction, command).ConfigureAwait(false));
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// ExecuteCommandNonQueryAsync
        /// </summary>
        /// <param name="Transaction"></param>
        /// <param name="dbName"></param>
        /// <param name="engineCommand"></param>
        /// <returns></returns>
        /// <exception cref="DatabaseException"></exception>
        public async Task <int> ExecuteCommandNonQueryAsync(IDbTransaction?Transaction, string dbName, EngineCommand engineCommand)
        {
            using MySqlCommand command = CreateTextCommand(engineCommand);

            if (Transaction == null)
            {
                return(await MySQLExecuter.ExecuteCommandNonQueryAsync(GetConnectionString(dbName, true), command).ConfigureAwait(false));
            }
            else
            {
                return(await MySQLExecuter.ExecuteCommandNonQueryAsync((MySqlTransaction)Transaction, command).ConfigureAwait(false));
            }
        }