Search for alternative list <KeyValuePair <string, KeyValuePair <string, string >>>

Ends with this terrible data structure:

List<KeyValuePair<string, KeyValuePair<string, string>>>

It will probably not become huge (<1K I estimate), and I will repeat this list again and again.

Can anyone think of a better alternative with inline types?

+5
source share
2 answers

A better option would be to wrap your own Tuple class, similar to sending in .NET 4.0 .

Then you can have one:

List<Tuple<string,string,string>>

It's easy enough to write in .NET 2.0 - it's basically just a triple of values, instead of having 2 in KeyValuePair. However, there is no built-in equivalent for triplet values ​​in .NET 2.0.


Edit:

, , -

1, /, :

Dictionary<string, List<KeyValuePair<string,string>>>

KeyValuePair . , ...

+10
struct MrStruct
{
   public string Key1,
   public string Key2,
   public string Value1
}


List<MrStruct>;

, , , . .

+10

All Articles