Assuming your goal is to ensure the each 'Value field of the Key-Value Pairs contained in your Dictionary has no duplicate Values:
public class DistinctList : List<string>
{
public new void Add(string value)
{
if (this.Contains(value)) return;
base.Add(value);
}
}
public class ValueDistinctDictionary : Dictionary<string, DistinctList>
{
public void Add(string key, string value)
{
if (!this.ContainsKey(key))
{
base.Add(key, new DistinctList());
}
base[key].Add(value);
}
}
ValueDistinctDictionary vDict = new ValueDistinctDictionary();
vDict.Add("hello", "goodbye");
vDict.Add("hello", "hello again");
vDict.Add("hello", "goodbye");
vDict.Add("hello1", "hello");
vDict.Add("hello1", "hello");
vDict.Add("hello1", "hello");