Browse Source

Update demo

SqlSugar5
sunkaixuan 2 years ago
parent
commit
f8a070fc12
  1. 9
      Src/Asp.Net/MySqlTest/Demo/Demo1_Queryable.cs
  2. 9
      Src/Asp.Net/PgSqlTest/Demo/Demo1_Queryable.cs
  3. 12
      Src/Asp.Net/SqlServerTest/Demo/Demo1_Queryable.cs
  4. 9
      Src/Asp.Net/SqliteTest/Demo/Demo1_Queryable.cs

9
Src/Asp.Net/MySqlTest/Demo/Demo1_Queryable.cs

@ -284,6 +284,15 @@ namespace OrmTest
var query2 = db.Queryable<Custom>();
var list3=db.Queryable(query1, query2,JoinType.Left, (p1, p2) => p1.CustomId == p2.Id).Select<ViewOrder>().ToList();
db.Queryable<Order>()
.Select(it => new { id = it.Id })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.id == y.ItemId)
.Select((x, y) => new { xid = x.id, yid = y.ItemId })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.yid == y.ItemId)// 最后一个表不是匿名对象就行
.ToList();
Console.WriteLine("#### Join Table End ####");
}

9
Src/Asp.Net/PgSqlTest/Demo/Demo1_Queryable.cs

@ -249,6 +249,15 @@ namespace OrmTest
var query2 = db.Queryable<Custom>();
var list3=db.Queryable(query1, query2,JoinType.Left, (p1, p2) => p1.CustomId == p2.Id).Select<ViewOrder>().ToList();
db.Queryable<Order>()
.Select(it => new { id = it.Id })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.id == y.ItemId)
.Select((x, y) => new { xid = x.id, yid = y.ItemId })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.yid == y.ItemId)// 最后一个表不是匿名对象就行
.ToList();
Console.WriteLine("#### Join Table End ####");
}

12
Src/Asp.Net/SqlServerTest/Demo/Demo1_Queryable.cs

@ -520,6 +520,18 @@ namespace OrmTest
.Where(m => m.Id == SqlFunc.Subqueryable<Order>()
.Where(z => z.Id == m.Id).GroupBy(z => z.Id).Select(z => z.Id))
.ToList();
var q2 = db.Queryable<Order>().Select(z => new { id = z.Id }).ToList();
db.Queryable<Order>()
.Select(it => new { id = it.Id })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.id == y.ItemId)
.Select((x, y) => new {xid=x.id,yid=y.ItemId})
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x,y)=>x.yid==y.ItemId)// 最后一个表不是匿名对象就行
.ToList();
Console.WriteLine("#### Join Table End ####");
}

9
Src/Asp.Net/SqliteTest/Demo/Demo1_Queryable.cs

@ -245,6 +245,15 @@ namespace OrmTest
var query2 = db.Queryable<Custom>();
var list3=db.Queryable(query1, query2,JoinType.Left, (p1, p2) => p1.CustomId == p2.Id).Select<ViewOrder>().ToList();
db.Queryable<Order>()
.Select(it => new { id = it.Id })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.id == y.ItemId)
.Select((x, y) => new { xid = x.id, yid = y.ItemId })
.MergeTable()//合并成一个表 和 OrderItem 进行JOIN
.LeftJoin<OrderItem>((x, y) => x.yid == y.ItemId)// 最后一个表不是匿名对象就行
.ToList();
Console.WriteLine("#### Join Table End ####");
}

Loading…
Cancel
Save