Update Demo

This commit is contained in:
skx 2021-02-04 15:54:42 +08:00
parent 85c8941fc0
commit 00c05aa393
3 changed files with 31 additions and 0 deletions

View File

@ -87,6 +87,7 @@
<Compile Include="Models\Unit\Custom1\EOrderReturnDetail.cs" />
<Compile Include="Models\Unit\Custom1\PurchaseDetailModel.cs" />
<Compile Include="Models\ViewOrder.cs" />
<Compile Include="UnitTest\UInsert.cs" />
<Compile Include="UnitTest\UQueue.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
Insert();
Queue();
CodeFirst();
Updateable();

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public partial class NewUnitTest
{
public class Unit4ASDF
{
[SqlSugar.SugarColumn(ColumnDataType = " bigint(20)",IsNullable =true)]
public long? Id { get; set; }
[SqlSugar.SugarColumn(ColumnDataType = " bigint(20)" )]
public long Id2 { get; set; }
}
public static void Insert()
{
Db.CodeFirst.InitTables<Unit4ASDF>();
Db.Insertable(new List<Unit4ASDF>() {
new Unit4ASDF() { Id=null, Id2=1 },
new Unit4ASDF() { Id=2, Id2=1 }}).UseMySql().ExecuteBlueCopy();
var list = Db.Queryable<Unit4ASDF>().ToList();
}
}
}