public static TValue?GetValueOrDefault <TKey, TValue>( this IReadOnlyDictionary <TKey, TValue> dictionary, TKey key) => dictionary.GetValueOrDefault <TKey, TValue>(key, default);
public static TValue GetValueOrDefault <TKey, TValue>(this IReadOnlyDictionary <TKey, TValue> dictionary, TKey key) where TKey : notnull { return(dictionary.GetValueOrDefault(key, default)); }
public static TValue?GetValueOrDefault <TKey, TValue>(this IReadOnlyDictionary <TKey, TValue> dictionary, TKey key) { return(dictionary.GetValueOrDefault(key, default !));
public static TValue GetValueOrDefault <TKey, TValue>(this IReadOnlyDictionary <TKey, TValue> dictionary, TKey key) where TKey : object { return(dictionary.GetValueOrDefault(key, default(TValue) !)); // TODO-NULLABLE: Remove ! when nullable attributes are respected }