ObjectCache.Remove(String, String) Método

Definição

Quando substituído em uma classe derivada, remove a entrada de cache do cache.When overridden in a derived class, removes the cache entry from the cache.

public abstract object Remove (string key, string regionName = default);
abstract member Remove : string * string -> obj
Public MustOverride Function Remove (key As String, Optional regionName As String = Nothing) As Object

Parâmetros

key
String

Um identificador exclusivo da entrada de cache.A unique identifier for the cache entry.

regionName
String

Opcional.Optional. Uma região nomeada no cache na qual a entrada de cache foi adicionada, caso as regiões tenham sido implementadas.A named region in the cache to which the cache entry was added, if regions are implemented. O valor padrão do parâmetro opcional é null.The default value for the optional parameter is null.

Retornos

Object

Um objeto que representa o valor da entrada do cache removido que foi especificado pela chave ou null, se a entrada especificada não foi encontrada.An object that represents the value of the removed cache entry that was specified by the key, or null if the specified entry was not found.

Comentários

Se você substituir esse método em uma implementação de cache Personalizada, se houver uma entrada de cache no cache que corresponde a key , o valor do item removido deverá ser retornado.If you override this method in a custom cache implementation, if there is a cache entry in the cache that corresponds to key, the value of the removed item should be returned. Se nada tiver sido removido do cache, o método deverá retornar null .If nothing was removed from the cache, the method should return null.

Observação

Algumas implementações de cache distribuído podem não oferecer suporte à capacidade de retornar o valor que foi removido do cache.Some distributed cache implementations might not support the ability to return the value that was removed from the cache. Isso pode ocorrer porque a implementação do cache não dá suporte ao retorno do valor de um item de cache removido.This might be because the cache implementation does not support returning the value of a removed cache item. Também pode ser porque o marshaling do objeto como um valor de retorno é muito caro.It might also be because marshaling the object as a return value is too expensive. Nesses casos, as implementações de cache podem retornar null .In such cases, cache implementations can return null.

Aplica-se a