Following code giving me \'Evaluation of lambda expressions is not valid in the debugger\'. Please suggest where I am doing wrong from below -
List
You will get a compiler error simply trying to convert a dictionary's values to a list with ToList():
Dictionary<int, int> dict = new Dictionary<int, int>();
var result = dict.Values.ToList();
Unless you include "using System.Linq" in your file.
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();