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