Since .NET Framework 2.0 and .NET Core 1.0 Class System.Collections.Specialized.OrderedDictionary
According to the key, to save the name price pairs with automatic pruning and quickly find an element based on the key. Add()
-Not objects expect methods.
Dr. Holgar Schwichtenberg is the technical manager of experts to www.it-vistions.de, which supports many medium sizes and large companies through advice and training with 53 famous experts as well as software development. Through his appearance in many national and international expert conferences as well as his appearance in more than 90 expert books and more than 1,500 expert articles, Holgar Schwichtanberg is one of the most famous experts for .NET and web techniques in Germany.

.NET 9.0 Microsoft at the end leads a general version OrderedDictionary
In the name room System.Collections.Generic
One with which you can tighten the type for keys and value.
Shows the use of the following code OrderedDictionary
,
public void GenericOrderedDictionary()
{
CUI.Demo(nameof(GenericOrderedDictionary));
OrderedDictionary d = new()
{
("www.IT-Visions.de") = 1996,
("www.dotnet7.de") = 2022,
("www.dotnet8.de") = 2023,
("www.dotnet-lexikon.de") = 2000,
};
d.Add("www.dotnet9.de", 2024);
d.RemoveAt(1);
d.Insert(0, "www.dotnetframework.de", 2000);
foreach (KeyValuePair entry in d)
{
Console.WriteLine(entry);
}
}
Listing Results:
(www.dotnetframework.de, 2000)
(www.IT-Visions.de, 1996)
(www.dotnet8.de, 2023)
(www.dotnet-lexikon.de, 2000)
(www.dotnet9.de, 2024)
(RME)
