From 9d690557adeece3272c42373e471c6b6869123d8 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 18 Jul 2023 20:31:33 +0800 Subject: [PATCH] Add unit test --- Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs index 959c23c66..2fc6ce9ee 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/DemoE_CodeFirst.cs @@ -70,9 +70,23 @@ namespace OrmTest db.Insertable(new Unittest1011() { name = "a" }).ExecuteCommand(); db.Insertable(new Unittest22221() { name = "a" }).ExecuteCommand(); db.CodeFirst.InitTables(); + db.CodeFirst.InitTables(); + var id=db.Insertable(new Unitrasdfafa() { Name = "Unitrasdfafa" }).ExecuteReturnIdentity(); + db.Updateable(new Unitrasdfafa() { Name = "Unitrasdfafa", id = id }).ExecuteCommand(); + var xx=db.Queryable().Select("*").ToDataTable(); Console.WriteLine("#### CodeFirst end ####"); } } + + [SugarTable("Unitrasdfafa",Discrimator ="Type:1,Type2:2")] + public class Unitrasdfafa + { + + [SugarColumn(IsIdentity =true,IsPrimaryKey =true)] + public int id { get; set; } + public string Name { get; set; } + } + [SugarTable("dbo.Unitrtqqqadfa")] public class Unitrtqqqadfa {