diff --git a/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs index 5af7b4a3d..41f48062f 100644 --- a/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs @@ -21,6 +21,9 @@ namespace OrmTest InitKeyType = InitKeyType.Attribute, IsAutoCloseConnection = true }); + db.CodeFirst.InitTables(); + db.Updateable(new T_DICT() { LABEL = "a", TYPE = "a", TYPENAME = "a", VALUE = "a" }) + .ExecuteCommand(); db.Aop.OnLogExecuting = (s, p) => Console.WriteLine(UtilMethods.GetNativeSql(s,p)); db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1 db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand(); @@ -40,6 +43,39 @@ namespace OrmTest Console.WriteLine("#### CodeFirst end ####"); } } + /// + /// 测试表 + /// + [SugarTable("T_DICT")] + public class T_DICT + { + /// + /// Desc:字典类型 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string TYPE { get; set; } = ""; + /// + /// Desc:字典名称 + /// Default: + /// Nullable:True + /// + public string? TYPENAME { get; set; } + /// + /// Desc:字典键值 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public string VALUE { get; set; } = ""; + /// + /// Desc:字典标签 + /// Default: + /// Nullable:False + /// + public string? LABEL { get; set; } + } public class CodeFirstUnitrew { public int Index { get; set; }