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); }
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); } }
public LarsLearningDeliveryModel GetLarsLearningDelivery(string learnAimRef) { LarsLearnAimRefs.TryGetValue(learnAimRef, out var learningDeliveryModel); return(learningDeliveryModel); }