var query = _bussubsidyRepository.GetAll().
Join(_instanceRepository.GetAll(), i => i.a.ToString(), j => j.id.ToString(), (i, j) => new { i, j }).DefaultIfEmpty();
query= await query
.GroupBy(e => new { e.i.a})
.Select(e => (new
{
a= e.i.a,
b= e.Max(m => m.i.b),
c= e.Sum(m => m.i.c)
}))
.OrderByDescending(e => e.i.a)
.PageBy(input)
.ToListAsync();
Join:表连接
GroupBy:分组
Select:显示列
OrderByDescending:排序
PageBy:分页
ToListAsync:转换为List型
网友评论