private PersonIdentity FindMatchingPerson(IEnumerable <MatchSpecification> match) { var conversionContext = new MatchSpecificationConversionContext(IdentifierDtoMarshaller); PersonIdentity FindPerson(MatchSpecification spec) => IdentityRepository.FindPersonBy(spec.ToPersonSpecification(conversionContext)); return(match.Select(FindPerson).FirstOrDefault()); }
private PersonIdentity FindPersonByNhsNumber(string nhsNumber) { return(repository.FindPersonBy( new CompositePersonSpecification(new PersonIdentifierSpecification(Identifiers.NhsNumber(nhsNumber))) )); }