Here's an extension method you can add to your project to emulate the behavior you want:
public static class Extensions
{
public static void AddOrUpdate<TKey, TValue>(this Dictionary<TKey, List<TValue>> dictionary, TKey key, TValue value)
{
if (dictionary.ContainsKey(key))
{
dictionary[key].Add(value);
}
else
{
dictionary.Add(key, new List<TValue>{value});
}
}
}
Usage:
Dictionary<string, List<string>> dct = new Dictionary<string, List<string>>();
dct.AddOrUpdate("key1", "value1");
dct.AddOrUpdate("key1", "value2");