ExtensionsAddOrSetTKey, TValue Method |
Dictionary helper that allows for idempotent updates. You don't need to care whether or not
this item is already in the collection in order to update it.
Namespace: Akka.Util.InternalAssembly: Akka (in Akka.dll) Version: 0.8.0.0 (0.8.0.0)
Syntaxpublic static void AddOrSet<TKey, TValue>(
this IDictionary<TKey, TValue> hash,
TKey key,
TValue value
)
<ExtensionAttribute>
Public Shared Sub AddOrSet(Of TKey, TValue) (
hash As IDictionary(Of TKey, TValue),
key As TKey,
value As TValue
)
public:
[ExtensionAttribute]
generic<typename TKey, typename TValue>
static void AddOrSet(
IDictionary<TKey, TValue>^ hash,
TKey key,
TValue value
)
[<ExtensionAttribute>]
static member AddOrSet :
hash : IDictionary<'TKey, 'TValue> *
key : 'TKey *
value : 'TValue -> unit
Parameters
- hash
- Type: System.Collections.GenericIDictionaryTKey, TValue
[Missing <param name="hash"/> documentation for "M:Akka.Util.Internal.Extensions.AddOrSet``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1)"]
- key
- Type: TKey
[Missing <param name="key"/> documentation for "M:Akka.Util.Internal.Extensions.AddOrSet``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1)"]
- value
- Type: TValue
[Missing <param name="value"/> documentation for "M:Akka.Util.Internal.Extensions.AddOrSet``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1)"]
Type Parameters
- TKey
[Missing <typeparam name="TKey"/> documentation for "M:Akka.Util.Internal.Extensions.AddOrSet``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1)"]
- TValue
[Missing <typeparam name="TValue"/> documentation for "M:Akka.Util.Internal.Extensions.AddOrSet``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1)"]
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IDictionaryTKey,
TValue. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also