c# check if value in dictionary are unique

77

c# check if value in dictionary are unique -

var dict = new Dictionary<string, int>();

if(dict.Values.Distinct().Count() == dict.Count)
{
  Console.WriteLine("values are distinct");
}

Comments

Submit
0 Comments