Browse Source

PGSQL Non-standard tables BUG

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

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

@ -13,7 +13,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 = Ado.GetScalar(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()).ObjToInt();
return result;
@ -22,7 +22,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 obj = await Ado.GetScalarAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
var result = obj.ObjToInt();

Loading…
Cancel
Save