RedisCache.GetAsync 方法
定义
重载
| GetAsync(String) | |
| GetAsync(String, CancellationToken) |
获取具有给定键的值。Gets a value with the given key. |
GetAsync(String)
public:
virtual System::Threading::Tasks::Task<cli::array <System::Byte> ^> ^ GetAsync(System::String ^ key);
public System.Threading.Tasks.Task<byte[]> GetAsync (string key);
abstract member GetAsync : string -> System.Threading.Tasks.Task<byte[]>
override this.GetAsync : string -> System.Threading.Tasks.Task<byte[]>
Public Function GetAsync (key As String) As Task(Of Byte())
参数
- key
- String
返回
实现
适用于
GetAsync(String, CancellationToken)
获取具有给定键的值。Gets a value with the given key.
public System.Threading.Tasks.Task<byte[]> GetAsync (string key, System.Threading.CancellationToken token = default);
abstract member GetAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<byte[]>
override this.GetAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<byte[]>
Public Function GetAsync (key As String, Optional token As CancellationToken = Nothing) As Task(Of Byte())
参数
- 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,其中包含找到的值或 null。The Task that represents the asynchronous operation, containing the located value or null.