Tuesday, May 10, 2011

Tuple in C#

in .net 4.0 Tuple keyword is introduced, this is new to C# and old to sql, F# etc,

Mostly tuple is used to return multiple values with out using ref or out key word.

Public Tuple ReturnMultipleObjects()
{
Tuple multipleObjects = Tuple.Create("string",1, new TextBox());
return multipleObjects ;
}

Msdn Link: http://msdn.microsoft.com/en-us/library/system.tuple.aspx
So Question: http://stackoverflow.com/questions/5951808/c-defined-arrays
Code Project: http://www.codeproject.com/KB/cs/C_Sharp_4_Tuples.aspx

No comments:

Post a Comment