mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-25 01:14:33 +08:00
Add unit test
This commit is contained in:
parent
bdc0170f31
commit
b94134bee3
@ -57,7 +57,29 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
throw new Exception("unit test");
|
throw new Exception("unit test");
|
||||||
}
|
}
|
||||||
|
db.CodeFirst.InitTables<OrderMain11, OrderAarray11>();
|
||||||
|
var id=db.Insertable(new OrderMain11() { Name = "a" }).ExecuteReturnIdentity();
|
||||||
|
db.Insertable(new OrderAarray11() { fk=id, Json = new int[] { 1} }).ExecuteCommand();
|
||||||
|
var list31 = db.Queryable<OrderAarray11>().ToList();
|
||||||
|
var list3=db.Queryable<OrderMain11>().LeftJoin<OrderAarray11>((t1, ti2) => t1.Id == ti2.fk)
|
||||||
|
.Select((t1, ti2) => new { t1.Id, t1.Name,json= ti2.Json }).ToList();
|
||||||
}
|
}
|
||||||
|
public class OrderMain11
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true,IsIdentity =true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
public class OrderAarray11
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey =true, IsIdentity = true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int fk { get; set; }
|
||||||
|
[SugarColumn(IsJson =true)]
|
||||||
|
public int[] Json { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class UnitJsonArray
|
public class UnitJsonArray
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user