diff --git a/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs index 41f48062f..9ef6d05ef 100644 --- a/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs @@ -40,9 +40,33 @@ namespace OrmTest var list2=db.Queryable().ToList(); db.CodeFirst.InitTables(); db.Insertable(new CodeFirstUnitrew() { Index = 1 }).ExecuteCommand(); + db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + db.DbMaintenance.TruncateTable(); + db.Insertable(new Unit00Z11C12() { type = UnitType.a, type2 = UnitType.b }).ExecuteCommand(); + var list3=db.Queryable().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; } + } /// /// 测试表 ///