using System.Collections.Generic; namespace Zepheus.Util { public static class Extensions { public static TValue GetOrDefault(this IDictionary instance, TKey key, TValue defaultValue = default(TValue)) { TValue result; return instance.TryGetValue(key, out result) ? result : defaultValue; } } }