예제 #1
0
        public IEnumerable <LarsLearningDeliveryModel> GetLarsLearningDelivery(IEnumerable <string> learnAimRefs)
        {
            var larsLearningDeliveries = new List <LarsLearningDeliveryModel>();

            foreach (var learnAimRef in learnAimRefs)
            {
                if (larsLearningDeliveries.Exists(lld => lld.LearnAimRef.CaseInsensitiveEquals(learnAimRef)))
                {
                    continue;
                }

                LarsLearnAimRefs.TryGetValue(learnAimRef, out var learningDeliveryModel);
                if (learningDeliveryModel != null)
                {
                    larsLearningDeliveries.Add(learningDeliveryModel);
                }
            }

            return(larsLearningDeliveries);
        }
예제 #2
0
        public async Task PopulateLarsLearningDeliveries(IEnumerable <string> learnAimRefs, CancellationToken cancellationToken)
        {
            var larsLearningDeliveries =
                await _referenceDataRepository.GetLarsLearningDelivery(learnAimRefs, cancellationToken);

            if (larsLearningDeliveries == null)
            {
                return;
            }

            foreach (var larsLearningDelivery in larsLearningDeliveries)
            {
                if (LarsLearnAimRefs.TryGetValue(larsLearningDelivery.Key, out _))
                {
                    continue;
                }

                LarsLearnAimRefs.Add(larsLearningDelivery.Key, larsLearningDelivery.Value);
            }
        }
예제 #3
0
        public LarsLearningDeliveryModel GetLarsLearningDelivery(string learnAimRef)
        {
            LarsLearnAimRefs.TryGetValue(learnAimRef, out var learningDeliveryModel);

            return(learningDeliveryModel);
        }