Beispiel #1
0
 public Task <T> ExecuteScalarAsync <T>(string sql, DynamicParameters parameters = null, CommandType?commandType = null)
 {
     if (CurrentTransaction != null)
     {
         return(DbExecProxyAsync <T>((param) => CurrentConnection.ExecuteScalarAsync <T>(sql, param, CurrentTransaction, CommandTimeout, commandType), sql, parameters));
     }
     using var connection = GetDbConnection(DataSourceEnum.SLAVE);
     return(DbExecProxyAsync <T>((param) => connection.ExecuteScalarAsync <T>(sql, param, CurrentTransaction, CommandTimeout, commandType), sql, parameters));
 }