- 修复 InsertValueSql 在仓储插入后不返回最新值;

This commit is contained in:
2881099
2022-04-24 16:11:18 +08:00
parent 1cd5539655
commit 87c71d5be3
5 changed files with 40 additions and 13 deletions

View File

@ -33,7 +33,7 @@ namespace FreeSql
async Task AddPrivAsync(TEntity data, bool isCheck, CancellationToken cancellationToken)
{
if (isCheck && CanAdd(data, true) == false) return;
if (_tableIdentitys.Length > 0)
if (_tableReturnColumns.Length > 0)
{
//有自增,马上执行
switch (_db.OrmOriginal.Ado.DataType)
@ -46,7 +46,7 @@ namespace FreeSql
case DataType.OdbcKingbaseES:
case DataType.ShenTong:
case DataType.Firebird: //firebird 只支持单条插入 returning
if (_tableIdentitys.Length == 1)
if (_tableIdentitys.Length == 1 && _tableReturnColumns.Length == 1)
{
await DbContextFlushCommandAsync(cancellationToken);
var idtval = await this.OrmInsert(data).ExecuteIdentityAsync(cancellationToken);
@ -98,7 +98,7 @@ namespace FreeSql
await AddAsync(data.First(), cancellationToken);
return;
}
if (_tableIdentitys.Length > 0)
if (_tableReturnColumns.Length > 0)
{
//有自增,马上执行
switch (_db.OrmOriginal.Ado.DataType)