mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 18:59:17 +08:00
unit test
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -37,6 +38,16 @@ namespace OrmTest
|
|||||||
Db.CodeFirst.InitTables<UnitLong1>();
|
Db.CodeFirst.InitTables<UnitLong1>();
|
||||||
Db.Insertable(new List<UnitLong1>() { new UnitLong1() { Num = null }, new UnitLong1() { Num = null } })
|
Db.Insertable(new List<UnitLong1>() { new UnitLong1() { Num = null }, new UnitLong1() { Num = null } })
|
||||||
.UseParameter().ExecuteCommand();
|
.UseParameter().ExecuteCommand();
|
||||||
|
if (Db.DbMaintenance.IsAnyTable("User", false))
|
||||||
|
Db.DbMaintenance.DropTable("User");
|
||||||
|
Db.CodeFirst.InitTables<User>();
|
||||||
|
}
|
||||||
|
public class User
|
||||||
|
{
|
||||||
|
[SugarColumn(IndexGroupNameList = new string[] { "index" })]
|
||||||
|
public int key { get; set; }
|
||||||
|
[SugarColumn(UniqueGroupNameList = new string[] { "index" })]
|
||||||
|
public int key2 { get; set; }
|
||||||
}
|
}
|
||||||
public class UnitLong1
|
public class UnitLong1
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user