How to get dictionary values as a generic list

前端 未结 10 1609
傲寒
傲寒 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条回答
  •  一向
    一向 (楼主)
    2020-12-24 05:11

    You probably want to flatten all of the lists in Values into a single list:

    List allItems = myDico.Values.SelectMany(c => c).ToList();
    

提交回复
热议问题