private async Task <TranscriptionLabels[]> GetAssignedLabels(long?importNumber) { var result = new List <TranscriptionLabels>(); if (!importNumber.HasValue) { return(result.ToArray()); } var labelGroups = await assignedLabelGroupsRepository.GetAsync(importNumber.Value); foreach (var labelGroup in labelGroups) { var labels = await transcriptionLabelsRepository.GetAllByGroupIdAsync(labelGroup.Id); result.Add(new TranscriptionLabels { LabelGroup = labelGroup, Labels = mapper.Map <TranscriptionLabelModel[]>(labels) }); } return(result.ToArray()); }
public async Task <TranscriptionLabelModel[]> GetTranscriptionLabelsAsync(long groupId) { var transcriptionLabels = await labelsRepository.GetAllByGroupIdAsync(groupId); return(mapper.Map <TranscriptionLabelModel[]>(transcriptionLabels)); }