mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update Oracle
This commit is contained in:
parent
9379477f8f
commit
6d6d85312d
@ -80,6 +80,7 @@
|
||||
<Compile Include="Models\ViewOrder.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnitTest\UInsert3.cs" />
|
||||
<Compile Include="UnitTest\Unit001.cs" />
|
||||
<Compile Include="UnitTest\UnitStorageableBool.cs" />
|
||||
<Compile Include="UnitTest\UCustom03.cs" />
|
||||
|
@ -34,6 +34,7 @@ namespace OrmTest
|
||||
}
|
||||
public static void Init()
|
||||
{
|
||||
UInsert3.Init();
|
||||
Unit001.Init();
|
||||
UnitStorageableBool.Init();
|
||||
UCustom03.Init();
|
||||
|
57
Src/Asp.Net/OracleTest/UnitTest/UInsert3.cs
Normal file
57
Src/Asp.Net/OracleTest/UnitTest/UInsert3.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
internal class UInsert3
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
var db = NewUnitTest.Db;
|
||||
db.Insertable(new Order() { Name = "a" }).ExecuteCommand();
|
||||
|
||||
db.Insertable(new List<Order>() {
|
||||
new Order() { Name = "a" },
|
||||
new Order() { Name = "a" }
|
||||
}).ExecuteCommand();
|
||||
|
||||
db.Insertable(new ORDER() { Name = "a" }).ExecuteCommand();
|
||||
}
|
||||
|
||||
public class Order
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true,OracleSequenceName = "Seq_Id")]
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
[SugarColumn(InsertServerTime =true)]
|
||||
public DateTime CreateTime { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int CustomId { get; set; }
|
||||
}
|
||||
|
||||
public class ORDER
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, OracleSequenceName = "Seq_Id")]
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
[SugarColumn(InsertSql = "sysdate")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int CustomId { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ namespace SqlSugar
|
||||
string columnsString = string.Join(",", groupList.First().Select(it => Builder.GetTranslationColumnName(it.DbColumnName)));
|
||||
if (isSingle&&this.EntityInfo.EntityName!= "Dictionary`2")
|
||||
{
|
||||
string columnParametersString = string.Join(",", this.DbColumnInfoList.Select(it => Builder.SqlParameterKeyWord + it.DbColumnName));
|
||||
string columnParametersString = string.Join(",", this.DbColumnInfoList.Select(it =>base.GetDbColumn(it, Builder.SqlParameterKeyWord + it.DbColumnName)));
|
||||
if (identities.HasValue())
|
||||
{
|
||||
columnsString = columnsString.TrimEnd(',') + "," + string.Join(",", identities.Select(it => Builder.GetTranslationColumnName(it.DbColumnName)));
|
||||
@ -99,7 +99,7 @@ namespace SqlSugar
|
||||
|
||||
|
||||
batchInsetrSql.Append("(");
|
||||
insertColumns = string.Join(",", item.Select(it => FormatValue(it.Value, it.PropertyName)));
|
||||
insertColumns = string.Join(",", item.Select(it =>GetDbColumn(it, FormatValue(it.Value, it.PropertyName))));
|
||||
batchInsetrSql.Append(insertColumns);
|
||||
if (identities.HasValue())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user