DictionaryExtensions.AddOrSet 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

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

returnValue = DictionaryExtensions.AddOrSet(dictionary, key, value)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function AddOrSet(Of TKey, TValue) ( _
    dictionary As IDictionary(Of TKey, TValue), _
    key As TKey, _
    value As TValue _
) As TValue
[ExtensionAttribute] 
public static TValue AddOrSet<TKey,TValue> (
    IDictionary<TKey,TValue> dictionary,
    TKey key,
    TValue value
)
[ExtensionAttribute] 
public:
generic<typename TKey, typename TValue>
static TValue AddOrSet (
    IDictionary<TKey, TValue>^ dictionary, 
    TKey key, 
    TValue value
)

GenericParameters

  • TKey
  • TValue

Parameters

  • dictionary
  • key
  • value

Return Value

Returns {0}.

Thread Safety

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

Platforms

Target Platforms

See Also

Reference

DictionaryExtensions Class
DictionaryExtensions Members
Microsoft.OneGet.Utility.Extensions Namespace