public IActionResult GetAllProviderByName([FromRoute] string name) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var providers = _verificationProviderRepository.GetAllByName(name); if (providers == null) { return(NotFound()); } return(Ok(providers)); }
// verify Customer's Contact-ID // This is where it would verify public key as well, but it is not implemented. private IEnumerable <VerificationProvider> GetProviders(Customer customer) { IEnumerable <VerificationProvider> verified; if (!string.IsNullOrEmpty(customer.ProviderName)) { var providers = _verificationProviderRepository.GetAllByName(customer.ProviderName); verified = providers.Where(p => p.Format.IsMatch(customer.ContactId)); } else { var providers = _verificationProviderRepository.GetAllProviders(); verified = providers.Where(p => p.Format.IsMatch(customer.ContactId)); } return(verified); }