ImmutableInterlocked.AddOrUpdate Metodo

Definizione

Overload

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

Ottiene il valore da un dizionario dopo averlo aggiunto o avere aggiornato una voce esistente.

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

Ottiene il valore da un dizionario dopo averlo aggiunto o avere aggiornato una voce esistente.

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

Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs

Ottiene il valore da un dizionario dopo averlo aggiunto o avere aggiornato una voce esistente.

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

Parametri di tipo

TKey

Tipo di chiave archiviata dal dizionario.

TValue

Tipo di valore archiviato dal dizionario.

Parametri

location
ImmutableDictionary<TKey,TValue>

Variabile o campo da aggiornare atomicamente se l'oggetto specificato non è nel dizionario.

key
TKey

Chiave per il valore da aggiungere o aggiornare.

addValueFactory
Func<TKey,TValue>

Funzione che riceve la chiave e restituisce un nuovo valore da aggiungere al dizionario quando non esiste alcun valore in precedenza.

updateValueFactory
Func<TKey,TValue,TValue>

Funzione che riceve la chiave e il valore precedente e restituisce il nuovo valore con cui aggiornare il dizionario.

Restituisce

TValue

Valore aggiunto o modificato.

Si applica a

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

Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs
Source:
ImmutableInterlocked.cs

Ottiene il valore da un dizionario dopo averlo aggiunto o avere aggiornato una voce esistente.

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

Parametri di tipo

TKey

Tipo di chiave archiviata dal dizionario.

TValue

Tipo di valore archiviato dal dizionario.

Parametri

location
ImmutableDictionary<TKey,TValue>

Variabile o campo da aggiornare atomicamente se l'oggetto specificato non è nel dizionario.

key
TKey

Chiave per il valore da aggiungere o aggiornare.

addValue
TValue

Valore da usare se non esiste alcun valore precedente.

updateValueFactory
Func<TKey,TValue,TValue>

Funzione che riceve la chiave e il valore precedente e restituisce il nuovo valore con cui aggiornare il dizionario.

Restituisce

TValue

Valore aggiunto o modificato.

Si applica a