DictionaryExtensions.GetOrAdd Method

This element is introduced in Windows PowerShell 5.0.


Namespace: Microsoft.OneGet.Utility.Extensions
Assembly: Microsoft.OneGet.Utility (in Microsoft.OneGet.Utility.dll)

'Usage
Dim dictionary As IDictionary(Of TKey, TValue)
Dim key As TKey
Dim valueFunction As Func(Of TValue)
Dim returnValue As TValue

returnValue = DictionaryExtensions.GetOrAdd(dictionary, key, valueFunction)

[ExtensionAttribute] 
public static TValue GetOrAdd<TKey,TValue> (
	IDictionary<TKey,TValue> dictionary,
	TKey key,
	Func<TValue> valueFunction
)

GenericParameters

TKey

TValue

Parameters

dictionary

key

valueFunction

Return Value

Returns {0}.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms


Show: