Add unit test

This commit is contained in:
sunkaixuan 2023-08-11 16:14:11 +08:00
parent 7461207551
commit a3d3b3a8ae

View File

@ -1,4 +1,5 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -13,12 +14,13 @@ namespace OrmTest
if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false))
Db.DbMaintenance.DropTable("UnitCodeTest1");
Db.CodeFirst.InitTables<UnitCodeTest1>();
Db.CodeFirst.InitTables<UnitCodeTest1>();
}
[SugarIndex("IndexUnitCodeTest1_CreateDate", nameof(CreateDate),OrderByType.Desc)]
public class UnitCodeTest1
{
[SqlSugar.SugarColumn(IndexGroupNameList = new string[] { "group1" })]
public int Id { get; set; }
[SqlSugar.SugarColumn(DefaultValue= "now()", IndexGroupNameList =new string[] {"group1" } )]
[SqlSugar.SugarColumn(DefaultValue= "now()" )]
public DateTime? CreateDate { get; set; }
}
}