public async Task <ReturnPagin <List <ReturnPersonalScheduleDto> > > QueryAsync(SelectPersonalScheduleDto model) { var result = new ReturnPagin <List <ReturnPersonalScheduleDto> >(); var personalSchedules = _context.PersonalSchedules.Include(i => i.StaffInfo).AsNoTracking(); result.Items = await personalSchedules.Select(i => new ReturnPersonalScheduleDto() { CreateTime = i.CreateTime, LastUpTime = i.LastUpTime, ScheduleTime = i.ScheduleTime, EventName = i.EventName, EventDetails = i.EventDetails, Id = i.Id, UserName = i.StaffInfo.Name }).ToListAsync(); result.Page = model.Page; result.Number = model.Number; result.Count = result.Items.Count; return(result); }
public async Task <IActionResult> QueryPaginAsync(SelectPersonalScheduleDto model) { var result = await _service.QueryAsync(model); return(Ok(result)); }