I’ve been search a lot about which one is better but I can’t find something like a comparison.
What is the advantage of using the ListDictionary Class instead of using a List of Dictionary’s?
I needed a List of dictionary in my project and i was searching when i found ListDictionary Class, but I can’t find something like a post to know more about which one is better on x or y project (I’m currently working on .NET 4+ and WPF).
>Solution :
ListDictionary is very specific implementation of dictionary.
From the docs https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.listdictionary?view=net-7.0
Implements IDictionary using a singly linked list. Recommended for collections that typically include fewer than 10 items.
It is not a list of dictionaries, it is just a single plain dictionary. And of course it is not an equivalent of the List<Dictionary>, which actually is a list of dictionaries.
Conclusion: if you need many dictionaries placed into the list, then the List<Dictionary> is only option for you. The ListDictionary is totally unusable here.