Convert dictionary values to list using linq

后端 未结 2 1319
北恋
北恋 2020-12-30 19:56

Following code giving me \'Evaluation of lambda expressions is not valid in the debugger\'. Please suggest where I am doing wrong from below -

List

        
2条回答
  •  盖世英雄少女心
    2020-12-30 20:31

    You don't need to use Linq to get the values. The Dictionary(TKey, TValue) has a property that holds the values, Dictionary(TKey, TValue).Values:

    var fields = objDictionary.Values.ToList();
    

提交回复
热议问题