Dictionarystring, string or NameValueCollection?

1

What's the difference in using Dictionary<string, string> and NameValueCollection ? I searched, but only found in English in the SOpt same, I used the translator, but the translation was strange and I did not understand.

    
asked by anonymous 22.01.2018 / 02:58

1 answer

1

The only thing you need to know is: do not use NameValueCollection . The specialized collections are practically obsolete. They were needed for C # 1.0, with the advent of generic collections, use them instead. The specialized ones do not receive more affection, they are probably outdated. It goes from Dictionary .

There is a difference, since the second is a multi map allowing you to have multiple values with the same key. But if you need this, and generally do not need to, then you want to use Lookup .

    
22.01.2018 / 03:14