Ejemplo n.º 1
0
        public async Task <PaginatedEntityResponseModel <PatientResponse> > GetPatientsAsync(int pageSize, int pageIndex,
                                                                                             string orderBy, string order, string search)
        {
            IEnumerable <Patient> patientsFromDb = await _patientRepository.GetAsync(pageSize, pageIndex,
                                                                                     orderBy, order, search);

            int totalPatients = await _patientRepository.CountPatients(search);

            IEnumerable <PatientResponse> patientResponses = patientsFromDb
                                                             .Select(x => _patientMapper.Map(x));

            return(new PaginatedEntityResponseModel <PatientResponse>(
                       pageIndex, pageSize, totalPatients, patientResponses));
        }
Ejemplo n.º 2
0
 public int CountPatients(string searchVal)
 {
     return(_patientRepository.CountPatients(searchVal));
 }