1

I am looking for a inbuilt Data Structure in C#, which can hold pair like Key, Value, Value.

For Example for Dictionary in C# we have Key and Value. Similarly I am Looking a inbuilt data structure, which holds Key, Value, Value. It should be generic.

Ashish
  • 29
  • 1

2 Answers2

3

How about Tuple<T1, T2, T3>?

It even supports up to 8 values.

Domysee
  • 12,718
  • 10
  • 53
  • 84
1

Dictionary<T1, Tuple<T2, T3>> works, as @Mant101 said in the comments. or Dictionary<T1, KeyValuePair<T2, T3>> if there is also a key-value relationship between T2 and T3

simonalexander2005
  • 4,338
  • 4
  • 48
  • 92