MemoryDistributedCache.RemoveAsync 方法

定义

重载

RemoveAsync(String)
RemoveAsync(String, CancellationToken)

删除具有给定键的值。Removes the value with the given key.

RemoveAsync(String)

public:
 virtual System::Threading::Tasks::Task ^ RemoveAsync(System::String ^ key);
public System.Threading.Tasks.Task RemoveAsync (string key);
abstract member RemoveAsync : string -> System.Threading.Tasks.Task
override this.RemoveAsync : string -> System.Threading.Tasks.Task
Public Function RemoveAsync (key As String) As Task

参数

key
String

返回

Task

实现

适用于

RemoveAsync(String, CancellationToken)

删除具有给定键的值。Removes the value with the given key.

public System.Threading.Tasks.Task RemoveAsync (string key, System.Threading.CancellationToken token = default);
abstract member RemoveAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.RemoveAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RemoveAsync (key As String, Optional token As CancellationToken = Nothing) As Task

参数

key
String

用于标识所请求的值的字符串。A string identifying the requested value.

token
CancellationToken

可选。Optional. CancellationToken,用于传播应取消操作的通知。The CancellationToken used to propagate notifications that the operation should be canceled.

返回

Task

表示异步操作的 TaskThe Task that represents the asynchronous operation.

实现

适用于