ImmutableInterlocked.AddOrUpdate Metod

Definition

Överlagringar

Name Description
AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, Func<TKey,TValue>, Func<TKey,TValue,TValue>)

Hämtar värdet från en ordlista när du har lagt till det eller uppdaterat en befintlig post.

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, TValue, Func<TKey,TValue,TValue>)

Hämtar värdet från en ordlista när du har lagt till det eller uppdaterat en befintlig post.

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, Func<TKey,TValue>, Func<TKey,TValue,TValue>)

Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs

Hämtar värdet från en ordlista när du har lagt till det eller uppdaterat en befintlig post.

public:
generic <typename TKey, typename TValue>
 static TValue AddOrUpdate(System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ % location, TKey key, Func<TKey, TValue> ^ addValueFactory, Func<TKey, TValue, TValue> ^ updateValueFactory);
public static TValue AddOrUpdate<TKey,TValue>(ref System.Collections.Immutable.ImmutableDictionary<TKey,TValue> location, TKey key, Func<TKey,TValue> addValueFactory, Func<TKey,TValue,TValue> updateValueFactory);
static member AddOrUpdate : ImmutableDictionary * 'Key * Func<'Key, 'Value> * Func<'Key, 'Value, 'Value> -> 'Value
Public Shared Function AddOrUpdate(Of TKey, TValue) (ByRef location As ImmutableDictionary(Of TKey, TValue), key As TKey, addValueFactory As Func(Of TKey, TValue), updateValueFactory As Func(Of TKey, TValue, TValue)) As TValue

Typparametrar

TKey

Den typ av nyckel som lagras i ordlistan.

TValue

Den typ av värde som lagras i ordlistan.

Parametrar

location
ImmutableDictionary<TKey,TValue>

Variabeln eller fältet som atomiskt uppdateras om den angivna inte finns i ordlistan.

key
TKey

Nyckeln för värdet som ska läggas till eller uppdateras.

addValueFactory
Func<TKey,TValue>

Funktionen som tar emot nyckeln och returnerar ett nytt värde att lägga till i ordlistan när det inte finns något värde tidigare.

updateValueFactory
Func<TKey,TValue,TValue>

Funktionen som tar emot nyckeln och föregående värde och returnerar det nya värdet som ordlistan ska uppdateras med.

Returer

TValue

Det tillagda eller uppdaterade värdet.

Gäller för

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, TValue, Func<TKey,TValue,TValue>)

Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs
Källa:
ImmutableInterlocked.cs

Hämtar värdet från en ordlista när du har lagt till det eller uppdaterat en befintlig post.

public:
generic <typename TKey, typename TValue>
 static TValue AddOrUpdate(System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ % location, TKey key, TValue addValue, Func<TKey, TValue, TValue> ^ updateValueFactory);
public static TValue AddOrUpdate<TKey,TValue>(ref System.Collections.Immutable.ImmutableDictionary<TKey,TValue> location, TKey key, TValue addValue, Func<TKey,TValue,TValue> updateValueFactory);
static member AddOrUpdate : ImmutableDictionary * 'Key * 'Value * Func<'Key, 'Value, 'Value> -> 'Value
Public Shared Function AddOrUpdate(Of TKey, TValue) (ByRef location As ImmutableDictionary(Of TKey, TValue), key As TKey, addValue As TValue, updateValueFactory As Func(Of TKey, TValue, TValue)) As TValue

Typparametrar

TKey

Den typ av nyckel som lagras i ordlistan.

TValue

Den typ av värde som lagras i ordlistan.

Parametrar

location
ImmutableDictionary<TKey,TValue>

Variabeln eller fältet som atomiskt uppdateras om den angivna inte finns i ordlistan.

key
TKey

Nyckeln för värdet som ska läggas till eller uppdateras.

addValue
TValue

Det värde som ska användas om det inte finns något tidigare värde.

updateValueFactory
Func<TKey,TValue,TValue>

Funktionen som tar emot nyckeln och föregående värde och returnerar det nya värdet som ordlistan ska uppdateras med.

Returer

TValue

Det tillagda eller uppdaterade värdet.

Gäller för