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