简体   繁体   中英

inbuilt Data Structure in C#, which can hold pair like Key, Value, Value

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.

How about Tuple<T1, T2, T3> ?

It even supports up to 8 values.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM