Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Not sure what this is called, anonymous tuple?
// 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