public async ValueTask <IEnumerable <Auditlog <TUserBrief> > > GetInfosAsync(Guid userid, int page, int pagesize) { var logs = await GetAsync(a => a, page, pagesize, "CreateTime", filter : a => a.OperatedObjectInfo.OperatedUserId == userid); var users = await userServices.GetAsync(u => mapper.Map <TUserBrief>(u), 0, pagesize, filter : Builders <TUser> .Filter.In(u => u.Id, logs.Select(l => l.Operator.Id))); var t = UpDateAsync(a => a.OperatedObjectInfo.OperatedUserId == userid, Builders <Auditlog <TUserBrief> > .Update .Set(a => a.ProcessedStamps, new List <ProcessedStamp>())); foreach (var item in logs) { item.Operator = users.Where(u => u.Id == item.Operator.Id).First(); } await t; return(logs); }
public async ValueTask <IEnumerable <T> > GetEmailsAsync() { return(await EmailQuery.GetAsync(e => e, 0, pageSize : null, orderBy : "ExpectSendTime", filter : Builders <T> .Filter.Lt(e => e.ExpectSendTime, DateTime.UtcNow))); }