CSharpTest.Net
AddOrUpdate(TKey,Converter<TKey,TValue>,KeyValueUpdate<TKey,TValue>) Method
See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > IConcurrentDictionary<TKey,TValue> Interface > AddOrUpdate Method : AddOrUpdate(TKey,Converter<TKey,TValue>,KeyValueUpdate<TKey,TValue>) Method

key
fnCreate
fnUpdate

Glossary Item Box

Adds a key/value pair to the IDictionary if the key does not already exist, or updates a key/value pair if the key already exists.

Syntax

Visual Basic (Declaration) 
Overloads Function AddOrUpdate( _
   ByVal key As TKey, _
   ByVal fnCreate As Converter(Of TKey,TValue), _
   ByVal fnUpdate As CSharpTest.Net.Collections.KeyValueUpdate(Of TKey,TValue) _
) As TValue
C# 
TValue AddOrUpdate( 
   TKey key,
   Converter<TKey,TValue> fnCreate,
   CSharpTest.Net.Collections.KeyValueUpdate<TKey,TValue> fnUpdate
)

Parameters

key
fnCreate
fnUpdate

Remarks

Adds or modifies an element with the provided key and value. If the key does not exist in the collection, the factory method fnCreate will be called to produce the new value, if the key exists, the converter method fnUpdate will be called to create an updated value.

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys