C# Dictionary with two Values per Key?

前端 未结 10 1307
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 17:36

I have a situation in code where a Dictionary seemed like the best idea - I need a collection of these objects and I need them to be acces

10条回答
  •  一整个雨季
    2020-12-13 18:01

    Actually, what you've just described is an ideal use for the Dictionary collection. It's supposed to contain key:value pairs, regardless of the type of value. By making the value its own class, you'll be able to extend it easily in the future, should the need arise.

提交回复
热议问题