From 4b95bfa295fe2fed2f6a610bcbcd32436d6892b3 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 1 Jul 2023 23:22:55 +0800 Subject: [PATCH] Add unit test --- Src/Asp.NetCore2/DmOrmTest/Demo/DemoE_CodeFirst.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Src/Asp.NetCore2/DmOrmTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.NetCore2/DmOrmTest/Demo/DemoE_CodeFirst.cs index cea14d83b..beaee7dc4 100644 --- a/Src/Asp.NetCore2/DmOrmTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.NetCore2/DmOrmTest/Demo/DemoE_CodeFirst.cs @@ -23,9 +23,17 @@ namespace OrmTest db.CodeFirst.InitTables(typeof(CodeFirstTable1));//Create CodeFirstTable1 db.Insertable(new CodeFirstTable1() { Name = "a", Text="a" }).ExecuteCommand(); var list = db.Queryable().ToList(); + if (db.DbMaintenance.IsAnyTable("CodeFirstafdasdfa")) + db.DbMaintenance.DropTable("CodeFirstafdasdfa"); + db.CodeFirst.InitTables(); + db.Insertable(new CodeFirstafdasdfa() { Id = Guid.NewGuid() }).ExecuteCommand(); Console.WriteLine("#### CodeFirst end ####"); } } + public class CodeFirstafdasdfa + { + public Guid Id { get; set; } + } public class CodeFirstTable1 {