using System.Collections.Generic; namespace PdmSwPlugin.Common.Util { public static class DictionaryUtil { public static T Get(this Dictionary dict, string key, T defaultValue = default) { if (key == null) { return defaultValue; } if (dict == null || !dict.ContainsKey(key)) { return defaultValue; } return dict[key]; } } }