- 增加 IUpdate.ExecuteUpdated 指定字段返回;

This commit is contained in:
2881099
2023-12-10 23:55:04 +08:00
parent 7ed542d859
commit 543ce4f513
19 changed files with 203 additions and 72 deletions

View File

@ -58,7 +58,8 @@ namespace FreeSql.Custom.MySql
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -146,9 +147,10 @@ namespace FreeSql.Custom.MySql
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -59,7 +59,8 @@ namespace FreeSql.Custom.PostgreSQL
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -163,9 +164,10 @@ namespace FreeSql.Custom.PostgreSQL
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -57,7 +57,8 @@ namespace FreeSql.Custom.SqlServer
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -149,9 +150,10 @@ namespace FreeSql.Custom.SqlServer
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -50,9 +50,10 @@ namespace FreeSql.Firebird.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)
@ -139,9 +140,10 @@ namespace FreeSql.Firebird.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -59,7 +59,8 @@ namespace FreeSql.KingbaseES
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -164,7 +165,8 @@ namespace FreeSql.KingbaseES
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}

View File

@ -57,9 +57,10 @@ namespace FreeSql.MySql.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)
@ -146,9 +147,10 @@ namespace FreeSql.MySql.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -59,7 +59,8 @@ namespace FreeSql.Odbc.KingbaseES
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -164,7 +165,8 @@ namespace FreeSql.Odbc.KingbaseES
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}

View File

@ -58,7 +58,8 @@ namespace FreeSql.Odbc.MySql
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -147,7 +148,8 @@ namespace FreeSql.Odbc.MySql
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}

View File

@ -59,7 +59,8 @@ namespace FreeSql.Odbc.PostgreSQL
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -164,7 +165,8 @@ namespace FreeSql.Odbc.PostgreSQL
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}

View File

@ -57,7 +57,8 @@ namespace FreeSql.Odbc.SqlServer
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -150,7 +151,8 @@ namespace FreeSql.Odbc.SqlServer
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}

View File

@ -58,9 +58,10 @@ namespace FreeSql.PostgreSQL.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)
@ -163,9 +164,10 @@ namespace FreeSql.PostgreSQL.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -94,10 +94,10 @@ namespace FreeSql.QuestDb.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction,
CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)
@ -219,10 +219,10 @@ namespace FreeSql.QuestDb.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection,
_transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -60,7 +60,8 @@ namespace FreeSql.ShenTong.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -165,7 +166,8 @@ namespace FreeSql.ShenTong.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}

View File

@ -57,7 +57,8 @@ namespace FreeSql.SqlServer.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
@ -149,9 +150,10 @@ namespace FreeSql.SqlServer.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)

View File

@ -58,9 +58,10 @@ namespace FreeSql.Xugu.Curd
Exception exception = null;
try
{
var rettmp = _orm.Ado.Query<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = _orm.Ado.Query<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}
catch (Exception ex)
@ -149,8 +150,9 @@ namespace FreeSql.Xugu.Curd
Exception exception = null;
try
{
var rettmp = await _orm.Ado.QueryAsync<TReturn>(_table.TypeLazy ?? _table.Type, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
{
var queryType = typeof(TReturn) == typeof(T1) ? (_table.TypeLazy ?? _table.Type) : null;
var rettmp = await _orm.Ado.QueryAsync<TReturn>(queryType, _connection, _transaction, CommandType.Text, sql, _commandTimeout, dbParms, cancellationToken);
ValidateVersionAndThrow(rettmp.Count, sql, dbParms);
ret.AddRange(rettmp);
}