Esempio n. 1
0
 public static TValue?GetValueOrDefault <TKey, TValue>(
     this IReadOnlyDictionary <TKey, TValue> dictionary,
     TKey key)
 => dictionary.GetValueOrDefault <TKey, TValue>(key, default);
Esempio n. 2
0
 public static TValue GetValueOrDefault <TKey, TValue>(this IReadOnlyDictionary <TKey, TValue> dictionary, TKey key) where TKey : notnull
 {
     return(dictionary.GetValueOrDefault(key, default));
 }
Esempio n. 3
0
 public static TValue?GetValueOrDefault <TKey, TValue>(this IReadOnlyDictionary <TKey, TValue> dictionary, TKey key)
 {
     return(dictionary.GetValueOrDefault(key, default !));
Esempio n. 4
0
 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
 }