using System.Collections.Generic;
namespace AIK.ViewModels
{
///
/// .NET Framework 4.8 兼容扩展方法(替代 Dictionary.GetValueOrDefault,该 API 在 net48 中不存在)
///
internal static class DictionaryExtensions
{
internal static TValue? GetValueOrDefault(this Dictionary dictionary, TKey key)
{
return dictionary.TryGetValue(key, out var value) ? value : default;
}
}
}