private async Task <IReadOnlyCollection <WorkItem> > GetWorkItemsFromBuild(int buildId) { var buildChanges = await _buildChangeRepository.GetBuildChangesByBuildId(buildId); var workItemIds = buildChanges .Select(bc => bc.ParseWorkItemId()) .Where(parseResult => parseResult.IsSuccess) .Select(ps => ps.WorkItemId).ToList(); if (!workItemIds.Any()) { return(new List <WorkItem>()); } var result = await _workItemRepository.GetWorkItemsByIdsAsync(workItemIds); return(result); }