From 764c1008ca31c194bedf2f51155890b3b4b932d6 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 8 May 2023 22:29:00 +0800 Subject: [PATCH] Update oracle demo --- .../OracleTest/Demo/DemoE_CodeFirst.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs index 3c28a6215..1e9d3c31b 100644 --- a/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.NetCore2/OracleTest/Demo/DemoE_CodeFirst.cs @@ -24,24 +24,25 @@ namespace OrmTest db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1 db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand(); var list = db.Queryable().ToList(); - db.CodeFirst.InitTables(); - db.Updateable(new List() { new CodeFirstTable22() { Name = "a" },new CodeFirstTable22() { Name = "a" } }) + db.CodeFirst.InitTables(); + db.Updateable(new List() { new CodeFirstTable22x2() { Name = "a" },new CodeFirstTable22x2() { Name = "a" } }) .ExecuteCommand(); - db.Updateable( new CodeFirstTable22() { Name = "a" } ) + db.Updateable( new CodeFirstTable22x2() { Name = "a" } ) .ExecuteCommand(); - db.Insertable(new List() { new CodeFirstTable22() { Name = "a" }, new CodeFirstTable22() { Name = "a" } }) + db.Insertable(new List() { new CodeFirstTable22x2() { Name = "a" }, new CodeFirstTable22x2() { Name = "a" } }) .ExecuteCommand(); - db.Insertable(new CodeFirstTable22() { Name = "a" }) + db.Insertable(new CodeFirstTable22x2() { Name = "a" }) .ExecuteCommand(); - var list2=db.Queryable().ToList(); + var list2=db.Queryable().ToList(); Console.WriteLine("#### CodeFirst end ####"); } } - public class CodeFirstTable22 + [SugarTable("CodeFirstTable22r2")] + public class CodeFirstTable22x2 { [SugarColumn(OracleSequenceName = "SEQ_ID", IsPrimaryKey = true)] public int Id { get; set; } - [SugarColumn(ColumnDataType ="nvarchar2",Length =200, SqlParameterDbType =typeof(Nvarchar2PropertyConvert) )] + [SugarColumn( SqlParameterDbType =typeof(Nvarchar2PropertyConvert) )] public string Name { get; set; } } public class CodeFirstTable1