ISolutionCacheService.TryGetItemAsync 方法

定义

尝试从缓存中检索分配给特定键的项。

public:
 System::Threading::Tasks::Task<bool> ^ TryGetItemAsync(Microsoft::VisualStudio::RpcContracts::Caching::CacheItemKey key, System::IO::Pipelines::PipeWriter ^ writer, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<bool> TryGetItemAsync (Microsoft.VisualStudio.RpcContracts.Caching.CacheItemKey key, System.IO.Pipelines.PipeWriter writer, System.Threading.CancellationToken cancellationToken);
abstract member TryGetItemAsync : Microsoft.VisualStudio.RpcContracts.Caching.CacheItemKey * System.IO.Pipelines.PipeWriter * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function TryGetItemAsync (key As CacheItemKey, writer As PipeWriter, cancellationToken As CancellationToken) As Task(Of Boolean)

参数

key
CacheItemKey

缓存项键,它是从实例中其检索的 usualy CacheContainer

writer
PipeWriter

用于流式传输内容的编写器。

cancellationToken
CancellationToken

要监视的取消标记。

返回

Task<Boolean>

如果找到项并且数据流入写入器,则为 true; 否则为 false。

适用于