mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 18:48:09 +08:00
Add unit test
This commit is contained in:
@@ -66,10 +66,26 @@ namespace OrmTest
|
||||
}
|
||||
};
|
||||
db.CodeFirst.InitTables<UnitIFTable>();
|
||||
db.CodeFirst.InitTables<Unittest1011, Unittest22221>();
|
||||
db.Insertable(new Unittest1011() { name = "a" }).ExecuteCommand();
|
||||
db.Insertable(new Unittest22221() { name = "a" }).ExecuteCommand();
|
||||
Console.WriteLine("#### CodeFirst end ####");
|
||||
}
|
||||
}
|
||||
|
||||
public class Unittest22221
|
||||
{
|
||||
[SugarColumn(DefaultValue = " newsequentialid()")]
|
||||
public Guid id { get; set; }
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public string name { get; set; }
|
||||
}
|
||||
public class Unittest1011
|
||||
{
|
||||
[SugarColumn(DefaultValue ="newid()")]
|
||||
public Guid id { get; set; }
|
||||
[SugarColumn(IsNullable =true)]
|
||||
public string name { get; set; }
|
||||
}
|
||||
public class UnitIFTable
|
||||
{
|
||||
//[SugarColumn(IsPrimaryKey =true,IsIdentity =true)]
|
||||
|
Reference in New Issue
Block a user