Skip to content

Instantly share code, notes, and snippets.

@spk33
Forked from ufcpp/TaskOfTuple.cs
Created March 9, 2022 10:16
Show Gist options
  • Save spk33/326347306789c8a3ccb53da63d7618da to your computer and use it in GitHub Desktop.
Save spk33/326347306789c8a3ccb53da63d7618da to your computer and use it in GitHub Desktop.
Task of Tuple for async return values
public async Task<(int sum, int count)> TallyAsync(IEnumerable<int> values) { ... }
var t = await TallyAsync(myValues);
Console.WriteLine($"Sum: {t.sum}, count: {t.count}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment