Browse Source

Add unit test

pull/18/head
sunkaixuan 3 years ago
parent
commit
b48eaf41e0
  1. 15
      Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs

15
Src/Asp.NetCore2/MySqlTest/UnitTest/UCodeFirst.cs

@ -13,6 +13,7 @@ namespace OrmTest
if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false))
Db.DbMaintenance.DropTable("UnitCodeTest1");
Db.CodeFirst.InitTables<UnitCodeTest1>();
Db.CodeFirst.InitTables<UnitCodeTest111>();
}
public class UnitCodeTest1
{
@ -21,5 +22,19 @@ namespace OrmTest
[SqlSugar.SugarColumn(DefaultValue="now()", IndexGroupNameList =new string[] {"group1" } )]
public DateTime? CreateDate { get; set; }
}
[SqlSugar.SugarIndex("UCTINDEX",
nameof(UnitCodeTest111.CreateDate),SqlSugar.OrderByType.Desc,
nameof(UnitCodeTest111.CreateDate2), SqlSugar.OrderByType.Desc,
nameof(UnitCodeTest111.CreateDate3), SqlSugar.OrderByType.Desc
)]
public class UnitCodeTest111
{
public int Id { get; set; }
public DateTime? CreateDate { get; set; }
public DateTime? CreateDate2 { get; set; }
public DateTime? CreateDate3 { get; set; }
}
}
}

Loading…
Cancel
Save