Skip to content

Instantly share code, notes, and snippets.

@ycaroafonso
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save ycaroafonso/25438e88490e7881fab8 to your computer and use it in GitHub Desktop.

Select an option

Save ycaroafonso/25438e88490e7881fab8 to your computer and use it in GitHub Desktop.
Tuple
// Exemplo 1:
Tuple<int, string, DateTime> pessoa = new Tuple<int, string, DateTime>(1, "Ycaro", new DateTime(2015, 2, 6));
Console.Write(string.Format("ID: {0}, Nome: {1}, Data: {2:dd/MM/yyyy}", pessoa.Item1, pessoa.Item2, pessoa.Item3));
// Exemplo 2:
int id = 2;
string nome = "Ycaro 2";
DateTime data = new DateTime(2015, 2, 7);
pessoa = Tuple.Create(id, nome, data);
Console.Write(string.Format("ID: {0}, Nome: {1}, Data: {2:dd/MM/yyyy}", pessoa.Item1, pessoa.Item2, pessoa.Item3));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment