Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created May 5, 2018 21:47
Show Gist options
  • Save christiannagel/43099b4929c7c470d8f327e47d806016 to your computer and use it in GitHub Desktop.
Save christiannagel/43099b4929c7c470d8f327e47d806016 to your computer and use it in GitHub Desktop.
Tuples with C# 7
// C# 6
var t1 = Tuple.Create(42, "astring");
int i1 = t1.Item1;
string s1 = t1.Item2;
// C# 7
var t1 = (n: 42, s: "magic");
int i1 = t1.n;
string s1 = t1.s;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment