public IList <ContractDeliverableCodeMapping> GetContractDeliverableCodeMapping(
            IList <string> deliverableCodes,
            CancellationToken cancellationToken)
        {
            var uncached = deliverableCodes.Where(deliverableCode => CodeMappings.All(x => x.ExternalDeliverableCode != deliverableCode)).ToList();

            if (uncached.Any())
            {
                CodeMappings.AddRange(_referenceDataRepository.GetContractDeliverableCodeMapping(uncached, cancellationToken));
            }

            return(CodeMappings);
        }
예제 #2
0
        public IEnumerable <FcsDeliverableCodeMapping> GetContractDeliverableCodeMapping(
            IEnumerable <string> deliverableCodes,
            CancellationToken cancellationToken)
        {
            var uncached = deliverableCodes
                           .Where(deliverableCode => CodeMappings
                                  .All(x => !x.ExternalDeliverableCode.CaseInsensitiveEquals(deliverableCode)))
                           .ToList();

            if (!uncached.Any())
            {
                return(CodeMappings);
            }

            PopulateContractDeliverableCodeMappings(uncached, cancellationToken);

            return(CodeMappings);
        }