How can I shorten List>>?

后端 未结 5 1143
醉酒成梦
醉酒成梦 2021-01-19 07:04

I want to store an list of key value pair lists in a lightweight structure. This seems too cumbersome. What\'s better? Does List> add

5条回答
  •  抹茶落季
    2021-01-19 07:36

    Both List and Dictionary are pretty efficient, so I wouldn't think twice about using them. (Unless you're going to be storing a gazillion dictionaries in your list, but that's not very common.)

    If you think that List> is too much to type, you can say in your preamble

    using LoDSS = System.Collections.Generic.List>;
    

    Note that this is just an alias no subclassing needed.

提交回复
热议问题