mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Add unit test
This commit is contained in:
@@ -40,9 +40,33 @@ namespace OrmTest
|
||||
var list2=db.Queryable<CodeFirstTable22x2>().ToList();
|
||||
db.CodeFirst.InitTables<CodeFirstUnitrew>();
|
||||
db.Insertable(new CodeFirstUnitrew() { Index = 1 }).ExecuteCommand();
|
||||
db = NewUnitTest.Db;
|
||||
db.CodeFirst.InitTables<Unit00Z11C12>();
|
||||
db.DbMaintenance.TruncateTable<Unit00Z11C12>();
|
||||
db.Insertable(new Unit00Z11C12() { type = UnitType.a, type2 = UnitType.b }).ExecuteCommand();
|
||||
var list3=db.Queryable<Unit00Z11C12>().Select(it => new DTO
|
||||
{
|
||||
unit00Z11C12 = it
|
||||
}).ToList();
|
||||
Console.WriteLine("#### CodeFirst end ####");
|
||||
}
|
||||
}
|
||||
public enum UnitType
|
||||
{
|
||||
a=0,
|
||||
b=2
|
||||
}
|
||||
public class DTO
|
||||
{
|
||||
public Unit00Z11C12 unit00Z11C12 { get; set; }
|
||||
}
|
||||
public class Unit00Z11C12
|
||||
{
|
||||
[SqlSugar.SugarColumn( IsNullable = true)]
|
||||
public UnitType type { get; set; }
|
||||
[SqlSugar.SugarColumn( IsNullable = true)]
|
||||
public UnitType? type2 { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 测试表
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user