public async Task <IList <YaeherPatientDoctor> > YaeherPatientDoctorList(YaeherPatientDoctorIn YaeherPatientDoctorInfo) { var YaeherPatientDoctors = await _repository.GetAllListAsync(YaeherPatientDoctorInfo.Expression); return(YaeherPatientDoctors.ToList()); }
public async Task <PagedResultDto <YaeherPatientDoctor> > YaeherPatientDoctorPage(YaeherPatientDoctorIn YaeherPatientDoctorInfo) { //初步过滤 var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(YaeherPatientDoctorInfo.Expression); //获取总数 var tasksCount = query.Count(); //获取总数 var totalpage = tasksCount / YaeherPatientDoctorInfo.MaxResultCount; var YaeherPatientDoctorList = await query.PageBy(YaeherPatientDoctorInfo.SkipTotal, YaeherPatientDoctorInfo.MaxResultCount).ToListAsync(); return(new PagedResultDto <YaeherPatientDoctor>(tasksCount, YaeherPatientDoctorList.MapTo <List <YaeherPatientDoctor> >())); }
/// <summary> /// 输出模型 /// </summary> /// <param name="YaeherPatientDoctorDto"></param> /// <param name="YaeherPatientDoctorInfo"></param> public YaeherPatientDoctorOut(PagedResultDto <YaeherPatientDoctor> YaeherPatientDoctorDto, YaeherPatientDoctorIn YaeherPatientDoctorInfo) { Items = YaeherPatientDoctorDto.Items; TotalCount = YaeherPatientDoctorDto.TotalCount; TotalPage = YaeherPatientDoctorDto.TotalCount / YaeherPatientDoctorInfo.MaxResultCount; SkipCount = YaeherPatientDoctorInfo.SkipCount; MaxResultCount = YaeherPatientDoctorInfo.MaxResultCount; }