public async Task <List <CertificateResponse> > Handle(GetCertificatesRequest request, CancellationToken cancellationToken) { var certificates = await _certificateRepository.GetCertificates(request.Statuses); var certificateResponses = Mapper.Map <List <Certificate>, List <CertificateResponse> >(certificates); return(certificateResponses); }
private async Task <IEnumerable <ThabCertificate> > GetCertificates(long sinumber, string insz) { if (string.IsNullOrEmpty(insz)) { var person = await _peopleService.GetAsync(new PersonKey(sinumber)); insz = person?.Insz; } var request = new GetCertificatesRequest() { SiNumber = sinumber, Insz = insz }; var response = await _service.GetCertificatesAsync(request); if (response.BusinessMessages != null && response.BusinessMessages.Length > 0) { throw new Exception(string.Join(';', response.BusinessMessages.Select(bm => bm.MessageString))); } return(_mapper.Map <IEnumerable <ThabCertificate> >(response?.Value?.Certificates)); }
GetCertificatesResponse IOnVifDevice.GetCertificates(GetCertificatesRequest request) { throw new NotImplementedException(); }