Browse Source

Update Core

pull/6/head
sunkaixuna 3 years ago
parent
commit
e2fd1c4515
  1. 4
      Src/Asp.NetCore2/SqlSeverTest/OracleTest/Demo/Demo3_Insertable.cs
  2. 14
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/Oracle/SqlBuilder/OracleBlukCopy.cs

4
Src/Asp.NetCore2/SqlSeverTest/OracleTest/Demo/Demo3_Insertable.cs

@ -36,6 +36,10 @@ namespace OrmTest
new Order() { Id = 12, Name = "order12" , Price=0}
};
//blukcopy
db.Insertable(updateObjs).UseOracle().ExecuteBlukCopy();
//Ignore CreateTime
db.Insertable(insertObj).IgnoreColumns(it => new { it.CreateTime }).ExecuteReturnIdentity();//get identity
db.Insertable(insertObj).IgnoreColumns("CreateTime").ExecuteReturnIdentity();

14
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Realization/Oracle/SqlBuilder/OracleBlukCopy.cs

@ -293,7 +293,19 @@ namespace SqlSugar
dt.Rows.Add(dr);
}
if (this.InsertBuilder.OracleSeqInfoList != null && this.InsertBuilder.OracleSeqInfoList.Any())
{
var ids = this.InsertBuilder.OracleSeqInfoList.Select(it => it.Value).ToList();
var columnInfo = this.InsertBuilder.EntityInfo.Columns.Where(it => !string.IsNullOrEmpty(it.OracleSequenceName)).First();
var identityName = columnInfo.DbColumnName;
ids.Add(this.Context.Ado.GetInt(" select " + columnInfo.OracleSequenceName + ".nextval from dual"));
int i = 0;
foreach (DataRow item in dt.Rows)
{
item[identityName] = ids[i];
++i;
}
}
return dt;
}

Loading…
Cancel
Save