public bool TryAdd(
TKey key,
TValue value
)Public Function TryAdd (
key As TKey,
value As TValue
) As Booleanpublic:
virtual bool TryAdd(
TKey key,
TValue value
) sealedabstract TryAdd :
key : 'TKey *
value : 'TValue -> bool
override TryAdd :
key : 'TKey *
value : 'TValue -> bool Unlike the Add method, this method doesn't throw an exception if the element with the given key exists in the CacheTKey, TValue. Unlike the indexer, TryAdd doesn't override the element if the element with the given key exists in the dictionary. If the key already exists, TryAdd does nothing and returns .
| ArgumentNullException | key is . |