Skip to content

Instantly share code, notes, and snippets.

@GrillPhil
Created May 31, 2018 20:22
Show Gist options
  • Save GrillPhil/d991823e7b35aa31a63cb71c87d21b11 to your computer and use it in GitHub Desktop.
Save GrillPhil/d991823e7b35aa31a63cb71c87d21b11 to your computer and use it in GitHub Desktop.
Step 6
var entryTasks = new List<Task<IEnumerable<TimeEntry>>>();
foreach (var project in projects)
{
entryTasks.Add(GetTimeEntriesForProject(httpClient, tenant, apiKey, baseUrl, project.Id));
}
await Task.WhenAll(entryTasks);
foreach (var task in entryTasks)
{
projects.Single(p => p.Id == task.Result.First().ProjectId).ConsumedBudget = task.Result.Sum(e => e.Minutes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment