optimize internal methods

This commit is contained in:
28810 2020-09-20 13:36:49 +08:00
parent 63dccf3e4c
commit 103ae63e9f
2 changed files with 4 additions and 2 deletions

View File

@ -44,7 +44,8 @@ namespace FreeSql
case DataType.KingbaseES: case DataType.KingbaseES:
case DataType.OdbcKingbaseES: case DataType.OdbcKingbaseES:
case DataType.ShenTong: case DataType.ShenTong:
if (_tableIdentitys.Length == 1 && _table.Primarys.Length == 1) case DataType.Firebird: //firebird 只支持单条插入 returning
if (_tableIdentitys.Length == 1)
{ {
await DbContextFlushCommandAsync(); await DbContextFlushCommandAsync();
var idtval = await this.OrmInsert(data).ExecuteIdentityAsync(); var idtval = await this.OrmInsert(data).ExecuteIdentityAsync();
@ -68,7 +69,7 @@ namespace FreeSql
} }
return; return;
default: default:
if (_tableIdentitys.Length == 1 && _table.Primarys.Length == 1) if (_tableIdentitys.Length == 1)
{ {
await DbContextFlushCommandAsync(); await DbContextFlushCommandAsync();
var idtval = await this.OrmInsert(data).ExecuteIdentityAsync(); var idtval = await this.OrmInsert(data).ExecuteIdentityAsync();

View File

@ -44,6 +44,7 @@ namespace FreeSql
case DataType.KingbaseES: case DataType.KingbaseES:
case DataType.OdbcKingbaseES: case DataType.OdbcKingbaseES:
case DataType.ShenTong: case DataType.ShenTong:
case DataType.Firebird: //firebird 只支持单条插入 returning
if (_tableIdentitys.Length == 1) if (_tableIdentitys.Length == 1)
{ {
DbContextFlushCommand(); DbContextFlushCommand();