Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Not sure what this is called, anonymous tuple?

View anonTuple.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// I want to be able to do this in C#
 
int a = 4;
int b = 2;
 
(a, b) = (b, a); // swap values
 
// ... and used in some terribly named methods...
 
public void AssignValues()
{
var (id, name) = GetValues();
// more statements
}
 
public int, string GetValues()
{
return (123, "gist");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.