Beispiel #1
0
        void IDictionary.Add(object key, object value)
        {
            switch (key)
            {
            case null:
                // key could be null
                // ConcurrentDictionary hates null
                throw new ArgumentNullException(nameof(key));

            case TKey keyAsTKey when value is TValue valueAsTValue:
                _wrapped.AddNew(keyAsTKey, valueAsTValue);
                break;

            default:
                break;
            }

            throw new ArgumentException(string.Empty, nameof(value));
        }