Exemple #1
0
        public IEnumerable <string> GetLearnerDuplicateLearnRefNumbers(List <MessageLearner> learners)
        {
            var duplicates = learners.GroupBy(x => x.LearnRefNumber, StringComparer.OrdinalIgnoreCase)
                             .Where(g => g.Count() > 1)
                             .Select(g => g.Key);

            foreach (var refNumber in duplicates)
            {
                _validationErrorHandler.CrossRecordValidationErrorHandler($"Duplicate LearnRefNumber:{refNumber} found for Learners", learners.FirstOrDefault().SourceFileName);
            }

            return(duplicates);
        }