[Solved] How can you select and filter dictionary keys based on their values using Linq?


there can ba multiple values that match the condition –

Dictionary<int, decimal> dict = new Dictionary<int,decimal>();
dict.Add(1, 392.3m); 
dict.Add(2, 612m); 
dict.Add(3, 981m); 
dict.Add(4, 344.23m);
List<int> Result = dict.Where(x => x.Value < 400).Select(x => x.Key).ToList();

0

solved How can you select and filter dictionary keys based on their values using Linq?