public async Task <IActionResult> SearchContactsForAnOrganisation(string endPointAssessorOrganisationId) { _logger.LogInformation( $"Received Search for Contacts using endPointAssessorOrganisationId = {endPointAssessorOrganisationId}"); var result = _searchOrganisationForContactsValidator.Validate(endPointAssessorOrganisationId); if (!result.IsValid) { throw new ResourceNotFoundException(result.Errors[0].ErrorMessage); } var contacts = Mapper.Map <List <ContactResponse> >(await _contactQueryRepository.GetContactsForEpao(endPointAssessorOrganisationId)).ToList(); return(Ok(contacts)); }