|
|
|
@@ -64,7 +64,7 @@ namespace FreeSql
|
|
|
|
|
DbParameter[] GetDbParamtersByObject(object obj);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// SQL 命令执行类,fsql.Ado.CommandFluent("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// SQL 命令执行类,fsql.Ado.CommandFluent("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// .WithConnection(connection)<para></para>
|
|
|
|
|
/// .WithTransaction(transaction)<para></para>
|
|
|
|
|
/// .WithParameter("age", 25)<para></para>
|
|
|
|
@@ -98,7 +98,7 @@ namespace FreeSql
|
|
|
|
|
void ExecuteReader(DbTransaction transaction, Action<FetchCallbackArgs<DbDataReader>> fetchHandler, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
void ExecuteReader(DbConnection connection, DbTransaction transaction, Action<FetchCallbackArgs<DbDataReader>> fetchHandler, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteReader(dr => {}, "select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteReader(dr => {}, "select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="fetchHandler"></param>
|
|
|
|
@@ -117,7 +117,7 @@ namespace FreeSql
|
|
|
|
|
object[][] ExecuteArray(DbTransaction transaction, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
object[][] ExecuteArray(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteArray("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteArray("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -136,7 +136,7 @@ namespace FreeSql
|
|
|
|
|
DataSet ExecuteDataSet(DbTransaction transaction, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
DataSet ExecuteDataSet(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteDataSet("select * from user where age > ?age; select 2", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteDataSet("select * from user where age > @age; select 2", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -155,7 +155,7 @@ namespace FreeSql
|
|
|
|
|
DataTable ExecuteDataTable(DbTransaction transaction, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
DataTable ExecuteDataTable(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteDataTable("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteDataTable("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -174,7 +174,7 @@ namespace FreeSql
|
|
|
|
|
int ExecuteNonQuery(DbTransaction transaction, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
int ExecuteNonQuery(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 在【主库】执行,ExecuteNonQuery("delete from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 在【主库】执行,ExecuteNonQuery("delete from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -193,7 +193,7 @@ namespace FreeSql
|
|
|
|
|
object ExecuteScalar(DbTransaction transaction, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
object ExecuteScalar(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 在【主库】执行,ExecuteScalar("select 1 from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 在【主库】执行,ExecuteScalar("select 1 from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -204,7 +204,7 @@ namespace FreeSql
|
|
|
|
|
object ExecuteScalar(DbConnection connection, DbTransaction transaction, string cmdText, object parms = null);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > ?age", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
/// <param name="cmdType"></param>
|
|
|
|
@@ -217,7 +217,7 @@ namespace FreeSql
|
|
|
|
|
List<T> Query<T>(Type resultType, DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
T QuerySingle<T>(CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
@@ -230,7 +230,7 @@ namespace FreeSql
|
|
|
|
|
T QuerySingle<T>(string cmdText, object parms = null);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > ?age; select * from address", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age; select * from address", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T1"></typeparam>
|
|
|
|
|
/// <typeparam name="T2"></typeparam>
|
|
|
|
@@ -242,7 +242,7 @@ namespace FreeSql
|
|
|
|
|
NativeTuple<List<T1>, List<T2>> Query<T1, T2>(DbTransaction transaction, CommandType cmdType, string cmdText, params DbParameter[] cmdParms);
|
|
|
|
|
NativeTuple<List<T1>, List<T2>> Query<T1, T2>(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, params DbParameter[] cmdParms);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > ?age; select * from address", new { age = 25 })<para></para>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age; select * from address", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T1"></typeparam>
|
|
|
|
@@ -298,7 +298,7 @@ namespace FreeSql
|
|
|
|
|
Task ExecuteReaderAsync(DbTransaction transaction, Func<FetchCallbackArgs<DbDataReader>, Task> readerHander, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task ExecuteReaderAsync(DbConnection connection, DbTransaction transaction, Func<FetchCallbackArgs<DbDataReader>, Task> readerHander, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteReaderAsync(dr => {}, "select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteReaderAsync(dr => {}, "select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="readerHander"></param>
|
|
|
|
@@ -319,7 +319,7 @@ namespace FreeSql
|
|
|
|
|
Task<object[][]> ExecuteArrayAsync(DbTransaction transaction, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<object[][]> ExecuteArrayAsync(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteArrayAsync("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteArrayAsync("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -340,7 +340,7 @@ namespace FreeSql
|
|
|
|
|
Task<DataSet> ExecuteDataSetAsync(DbTransaction transaction, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<DataSet> ExecuteDataSetAsync(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteDataSetAsync("select * from user where age > ?age; select 2", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteDataSetAsync("select * from user where age > @age; select 2", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -361,7 +361,7 @@ namespace FreeSql
|
|
|
|
|
Task<DataTable> ExecuteDataTableAsync(DbTransaction transaction, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<DataTable> ExecuteDataTableAsync(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询,ExecuteDataTableAsync("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 查询,ExecuteDataTableAsync("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -382,7 +382,7 @@ namespace FreeSql
|
|
|
|
|
Task<int> ExecuteNonQueryAsync(DbTransaction transaction, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<int> ExecuteNonQueryAsync(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 在【主库】执行,ExecuteNonQueryAsync("delete from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 在【主库】执行,ExecuteNonQueryAsync("delete from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -403,7 +403,7 @@ namespace FreeSql
|
|
|
|
|
Task<object> ExecuteScalarAsync(DbTransaction transaction, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<object> ExecuteScalarAsync(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 在【主库】执行,ExecuteScalarAsync("select 1 from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 在【主库】执行,ExecuteScalarAsync("select 1 from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cmdText"></param>
|
|
|
|
@@ -415,7 +415,7 @@ namespace FreeSql
|
|
|
|
|
Task<object> ExecuteScalarAsync(DbConnection connection, DbTransaction transaction, string cmdText, object parms = null, CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,QueryAsync<User>("select * from user where age > ?age", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// 执行SQL返回对象集合,QueryAsync<User>("select * from user where age > @age", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
/// <param name="cmdType"></param>
|
|
|
|
@@ -429,7 +429,7 @@ namespace FreeSql
|
|
|
|
|
Task<List<T>> QueryAsync<T>(Type resultType, DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<T> QuerySingleAsync<T>(string cmdText, object parms = null, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,QueryAsync<User>("select * from user where age > ?age", new { age = 25 })<para></para>
|
|
|
|
|
/// 执行SQL返回对象集合,QueryAsync<User>("select * from user where age > @age", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
@@ -443,7 +443,7 @@ namespace FreeSql
|
|
|
|
|
Task<T> QuerySingleAsync<T>(CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > ?age; select * from address", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age; select * from address", new SqlParameter { ParameterName = "age", Value = 25 })
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T1"></typeparam>
|
|
|
|
|
/// <typeparam name="T2"></typeparam>
|
|
|
|
@@ -456,7 +456,7 @@ namespace FreeSql
|
|
|
|
|
Task<NativeTuple<List<T1>, List<T2>>> QueryAsync<T1, T2>(DbTransaction transaction, CommandType cmdType, string cmdText, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
Task<NativeTuple<List<T1>, List<T2>>> QueryAsync<T1, T2>(DbConnection connection, DbTransaction transaction, CommandType cmdType, string cmdText, int cmdTimeout, DbParameter[] cmdParms, CancellationToken cancellationToken = default);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User, Address>("select * from user where age > ?age; select * from address", new { age = 25 })<para></para>
|
|
|
|
|
/// 执行SQL返回对象集合,Query<User, Address>("select * from user where age > @age; select * from address", new { age = 25 })<para></para>
|
|
|
|
|
/// 提示:parms 参数还可以传 Dictionary<string, object>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T1"></typeparam>
|
|
|
|
|