namespace Yw.Epanet
{
///
/// 字典拓展
///
internal static class DictionaryExtensions
{
///
/// 获取值
///
public static TValve GetValue(this Dictionary dict, string key)
{
if (dict == null || dict.Count < 1)
{
return default;
}
if (string.IsNullOrEmpty(key))
{
return default;
}
if (dict.ContainsKey(key))
{
return dict[key];
}
return default;
}
}
}