Browse Source

Add unit test

pull/31/head
sunkaixuan 2 years ago
parent
commit
f8ea52a9f0
  1. 13
      Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs

13
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);
}
/// <summary>

Loading…
Cancel
Save