src/NetStandard/Collections/Collections/src/Generic/NullableKeyDictionary.cs
/// <summary>
/// Adds an element with the provided key and value to the <see cref="INullableKeyDictionary{KeyType, ValueType}"/>.
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
Adds an element with the provided key and value to the .
Adds an element with the provided key and value to the .
public void Add(YetNullable<KeyType> key, ValueType value)
        {
            if (IsReadOnly) {
                throw new NotSupportedException("");
            }
            if (key.IsNull) {
                if (nullableKeyValuePair.HasValue) {
                    throw new ArgumentException();
                }
                nullableKeyValuePair = new KeyValuePair<YetNullable<KeyType>, ValueType>(key, value!);
            } else {
                dictionary.Add(key.value, value!);
            }
        }
public void Add ( YetNullable < KeyType > key , ValueType value ) { if ( IsReadOnly ) { throw new NotSupportedException ( " " ) ; } if ( key . IsNull ) { if ( nullableKeyValuePair . HasValue ) { throw new ArgumentException ( ) ; } nullableKeyValuePair = new KeyValuePair < YetNullable < KeyType > , ValueType > ( key , value ! ) ; } else { dictionary . Add ( key . value , value ! ) ; } }
Adds an element with the provided key and value to the .
Adds an element with the provided key and value to the .
key
YetNullable<KeyType>
None
value
ValueType
None