Browse Source

Add unit test

pull/40/head
sunkaixuan 1 year ago
parent
commit
4b95bfa295
  1. 8
      Src/Asp.NetCore2/DmOrmTest/Demo/DemoE_CodeFirst.cs

8
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<CodeFirstTable1>().ToList();
if (db.DbMaintenance.IsAnyTable("CodeFirstafdasdfa"))
db.DbMaintenance.DropTable("CodeFirstafdasdfa");
db.CodeFirst.InitTables<CodeFirstafdasdfa>();
db.Insertable(new CodeFirstafdasdfa() { Id = Guid.NewGuid() }).ExecuteCommand();
Console.WriteLine("#### CodeFirst end ####");
}
}
public class CodeFirstafdasdfa
{
public Guid Id { get; set; }
}
public class CodeFirstTable1
{

Loading…
Cancel
Save