Browse Source

Update unit test

pull/18/head
sunkaixuan 3 years ago
parent
commit
34c72c0892
  1. 24
      Src/Asp.Net/PgSqlTest/UnitTest/UCodeFirst.cs

24
Src/Asp.Net/PgSqlTest/UnitTest/UCodeFirst.cs

@ -41,6 +41,30 @@ namespace OrmTest
if (Db.DbMaintenance.IsAnyTable("User", false)) if (Db.DbMaintenance.IsAnyTable("User", false))
Db.DbMaintenance.DropTable("User"); Db.DbMaintenance.DropTable("User");
Db.CodeFirst.InitTables<User>(); Db.CodeFirst.InitTables<User>();
if (Db.DbMaintenance.IsAnyTable("UnitCodeFirst131", false))
Db.DbMaintenance.DropTable("UnitCodeFirst131");
Db.CodeFirst.InitTables<UnitCodeFirst131>();
Db.Insertable(new UnitCodeFirst131() { Id = 1 }).ExecuteCommand();
Db.CodeFirst.InitTables<UNITCODEFIRST131>();
Db.CodeFirst.InitTables<UNITCOdEFIRST131>();
}
public class UnitCodeFirst131
{
public int Id { get; set; }
}
public class UNITCODEFIRST131
{
public int Id { get; set; }
[SqlSugar.SugarColumn(DefaultValue = "a")]
public string Name { get; set; }
}
public class UNITCOdEFIRST131
{
public int Id { get; set; }
[SqlSugar.SugarColumn(DefaultValue = "a")]
public string Name { get; set; }
[SqlSugar.SugarColumn(DefaultValue = "0")]
public int dt { get; set; }
} }
public class User public class User
{ {

Loading…
Cancel
Save