using System; using System.Collections.Generic; namespace BITKit { public static partial class Extensions { public static IDictionary CreateOrAddIfEmety(this IDictionary self, TKey key, Func createFactory) { if (self.ContainsKey(key) is false) { self.Add(key, createFactory.Invoke()); } return self; } } }