This commit is contained in:
xuejmnet 2021-02-03 07:51:44 +08:00
parent 9f84226ef3
commit 973c09e0db
1 changed files with 6 additions and 1 deletions

View File

@ -178,7 +178,9 @@ Release | EF Core | .NET Standard | .NET (Core) | Sql Server | Pomelo.EntityFra
public async Task ToList_All() public async Task ToList_All()
{ {
//查询list集合
var all=await _virtualDbContext.Set<SysUserMod>().ToShardingListAsync(); var all=await _virtualDbContext.Set<SysUserMod>().ToShardingListAsync();
//链接查询
var list = await (from u in _virtualDbContext.Set<SysUserMod>() var list = await (from u in _virtualDbContext.Set<SysUserMod>()
join salary in _virtualDbContext.Set<SysUserSalary>() join salary in _virtualDbContext.Set<SysUserSalary>()
on u.Id equals salary.UserId on u.Id equals salary.UserId
@ -188,7 +190,8 @@ Release | EF Core | .NET Standard | .NET (Core) | Sql Server | Pomelo.EntityFra
DateOfMonth = salary.DateOfMonth, DateOfMonth = salary.DateOfMonth,
Name = u.Name Name = u.Name
}).ToShardingListAsync(); }).ToShardingListAsync();
var ids = new[] {"200", "300"}; //聚合查询
var ids = new[] {"200", "300"};
var dateOfMonths = new[] {202111, 202110}; var dateOfMonths = new[] {202111, 202110};
var group = await (from u in _virtualDbContext.Set<SysUserSalary>() var group = await (from u in _virtualDbContext.Set<SysUserSalary>()
.Where(o => ids.Contains(o.UserId) && dateOfMonths.Contains(o.DateOfMonth)) .Where(o => ids.Contains(o.UserId) && dateOfMonths.Contains(o.DateOfMonth))
@ -310,6 +313,8 @@ context.Where(shardingBatchUpdateEntry.Where).Update(shardingBatchUpdateEntry.Up
凭借各大开源生态圈提供的优秀代码和思路才有的这个框架,希望可以为.Net生态提供一份微薄之力,该框架本人会一直长期维护,有大神技术支持可以联系下方方式欢迎star :) 凭借各大开源生态圈提供的优秀代码和思路才有的这个框架,希望可以为.Net生态提供一份微薄之力,该框架本人会一直长期维护,有大神技术支持可以联系下方方式欢迎star :)
[博客](https://www.cnblogs.com/xuejiaming)
QQ群:771630778 QQ群:771630778
个人QQ:326308290(欢迎技术支持提供您宝贵的意见) 个人QQ:326308290(欢迎技术支持提供您宝贵的意见)