ImmutableInterlocked.AddOrUpdate Método

Definição

Sobrecargas

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

Obtém o valor a partir de um dicionário depois de o ter adicionado ou atualizado uma entrada existente.

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

Obtém o valor a partir de um dicionário depois de o ter adicionado ou atualizado uma entrada existente.

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

Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs

Obtém o valor a partir de um dicionário depois de o ter adicionado ou atualizado uma entrada existente.

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

Parâmetros de Tipo Genérico

TKey

O tipo de chave armazenada no dicionário.

TValue

O tipo de valor armazenado pelo dicionário.

Parâmetros

location
ImmutableDictionary<TKey,TValue>

A variável ou campo a atualizar atomicamente se o especificado não estiver no dicionário.

key
TKey

A chave para o valor a acrescentar ou atualizar.

addValueFactory
Func<TKey,TValue>

A função que recebe a chave e devolve um novo valor para adicionar ao dicionário quando não existe nenhum valor anteriormente.

updateValueFactory
Func<TKey,TValue,TValue>

A função que recebe a chave e o valor anterior e devolve o novo valor com o qual atualizar o dicionário.

Devoluções

TValue

O valor acrescentado ou atualizado.

Aplica-se a

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

Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs
Origem:
ImmutableInterlocked.cs

Obtém o valor a partir de um dicionário depois de o ter adicionado ou atualizado uma entrada existente.

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

Parâmetros de Tipo Genérico

TKey

O tipo de chave armazenada no dicionário.

TValue

O tipo de valor armazenado pelo dicionário.

Parâmetros

location
ImmutableDictionary<TKey,TValue>

A variável ou campo a atualizar atomicamente se o especificado não estiver no dicionário.

key
TKey

A chave para o valor a acrescentar ou atualizar.

addValue
TValue

O valor a usar se não existir valor anterior.

updateValueFactory
Func<TKey,TValue,TValue>

A função que recebe a chave e o valor anterior e devolve o novo valor com o qual atualizar o dicionário.

Devoluções

TValue

O valor acrescentado ou atualizado.

Aplica-se a