using System.Collections.Generic; namespace EntrustSettle.Common.Extensions; public static class DictionaryExtensions { public static void TryAdd(this IDictionary> dic, TKey key, TValue value) { if (dic.TryGetValue(key, out var old)) { old.Add(value); } else { dic.Add(key, new List {value}); } } }