Exemple #1
0
        public IActionResult GetAllProvider()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var providers = _verificationProviderRepository.GetAllProviders();

            if (providers == null)
            {
                return(NotFound());
            }
            return(Ok(providers));
        }
Exemple #2
0
        // 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);
        }