Browse Source

-

pull/8/head
sunkaixuna 3 years ago
parent
commit
f6eb75f1f3
  1. 4
      Src/Asp.Net/SqlSugar/Realization/PostgreSQL/Insertable/PostgreSQLInserttable.cs

4
Src/Asp.Net/SqlSugar/Realization/PostgreSQL/Insertable/PostgreSQLInserttable.cs

@ -38,7 +38,7 @@ namespace SqlSugar
{
InsertBuilder.IsReturnIdentity = true;
PreToSql();
string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", GetIdentityKeys().FirstOrDefault());
string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", this.SqlBuilder.GetTranslationColumnName(GetIdentityKeys().FirstOrDefault()));
RestoreMapping();
var result = Convert.ToInt64(Ado.GetScalar(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()) ?? "0");
return result;
@ -47,7 +47,7 @@ namespace SqlSugar
{
InsertBuilder.IsReturnIdentity = true;
PreToSql();
string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", GetIdentityKeys().FirstOrDefault());
string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", this.SqlBuilder.GetTranslationColumnName(GetIdentityKeys().FirstOrDefault()));
RestoreMapping();
var result = Convert.ToInt64(await Ado.GetScalarAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()) ?? "0");
return result;

Loading…
Cancel
Save