I need a collection that
- contains a set of objects linked to a double.
- The sequence of these pairs should be arbitrary set by me (based on an int I get from the database) and be static throughout the lifecycle.
- The number of entries will be small (0 ~ 20) but varying.
- The collection should be itteratable.
- I don't have to search the collection for anything.
- The double will be changed after intialization of the collection.
- I would like to work with existing datatypes (no new classes) since it will be used in my asp.net mvc controllers, views and services and I don't want them to all to have a dependency on a library just for this stupid holder class.
I thought
IDictionary<int, KeyvaluePair<TheType, double>>
would do the trick, but then I can't set the double after init.
--Edit--
I found out that the classes generated by the linq 2 sql visual studio thingy are actually partial classes so you can add to them whatever you want. I solved my question by adding a double field to the partial class.
Thanks all for the answers you came up with.