How to get dictionary values as a generic list

前端 未结 10 1586
傲寒
傲寒 2020-12-24 04:45

I just want get a list from Dictionary values but it\'s not so simple as it appears !

here the code :

Dictionary> my         


        
10条回答
  •  萌比男神i
    2020-12-24 05:08

    Off course, myDico.Values is List>.

    Use Linq if you want to flattern your lists

    var items = myDico.SelectMany (d => d.Value).ToList();
    

提交回复
热议问题