From f8ea52a9f0478fedc3c17b1758cf88c71a7c83fe Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 20 Mar 2023 20:31:06 +0800 Subject: [PATCH] Add unit test --- Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs index 77b0a05c7..c4899fea2 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs @@ -126,6 +126,19 @@ namespace OrmTest { throw new Exception("unit error"); } + + var type = db.DynamicBuilder().CreateClass("UnitEntityA", + new SugarTable() + { + TableDescription = "表备注", + //DisabledUpdateAll=true 可以禁止更新只创建 + } + ) + .CreateProperty("Id", typeof(int), new SugarColumn() { IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "列备注" }) + .CreateProperty("Name", typeof(string), new SugarColumn() {Length=200, ColumnDescription = "列备注" }) + .BuilderType(); + + db.CodeFirst.InitTables(type); } ///