I need to implement Comparison
delegate for Tuple. And I have a column number by which I want to compare Tuples.
For now I got to:
int sortedColumn;
Comparison<Tuple<T1, T2, T3>> tupleComparison = (x, y) =>
{
// I want to access x.Item2 if sortedColumn = 2
// x.Item3 if sortedColumn = 2 etc
};
How can I do this in c#?
Can I do it without using switch
?