예제 #1
0
        public async Task <IEnumerable <ApplicationSequence> > GetApplicationSequences(Guid applicationId)
        {
            var sequencesTask = _qnaApiClient.GetSequences(applicationId);
            var sectionsTask  = _qnaApiClient.GetSections(applicationId);

            await Task.WhenAll(sequencesTask, sectionsTask);

            var sequences = await sequencesTask;
            var sections  = await sectionsTask;

            PopulateAdditionalSequenceFields(sequences);

            var filteredSequences = sequences.Where(x => x.SequenceId != RoatpWorkflowSequenceIds.Preamble && x.SequenceId != RoatpWorkflowSequenceIds.ConditionsOfAcceptance).OrderBy(y => y.SequenceId);

            foreach (var sequence in filteredSequences)
            {
                sequence.Sections = new List <ApplicationSection>(sections.Where(sec => sec.SequenceId == sequence.SequenceId));
            }

            return(filteredSequences.ToList());
        }