Udostępnij za pośrednictwem


ISolutionCacheService.AddItemAsync Method

Definition

Tries to add an item to cache and return a unique key. Stream will be read till end to determine content and size.

public:
 System::Threading::Tasks::Task<Microsoft::VisualStudio::RpcContracts::Caching::CacheItemKey> ^ AddItemAsync(System::IO::Pipelines::PipeReader ^ reader, Microsoft::VisualStudio::RpcContracts::Caching::CacheStorageTypes storageTypes, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<Microsoft.VisualStudio.RpcContracts.Caching.CacheItemKey> AddItemAsync (System.IO.Pipelines.PipeReader reader, Microsoft.VisualStudio.RpcContracts.Caching.CacheStorageTypes storageTypes, System.Threading.CancellationToken cancellationToken);
abstract member AddItemAsync : System.IO.Pipelines.PipeReader * Microsoft.VisualStudio.RpcContracts.Caching.CacheStorageTypes * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.RpcContracts.Caching.CacheItemKey>
Public Function AddItemAsync (reader As PipeReader, storageTypes As CacheStorageTypes, cancellationToken As CancellationToken) As Task(Of CacheItemKey)

Parameters

reader
PipeReader

Reader to utilize for reading contents of the entry.

storageTypes
CacheStorageTypes

Types of storage to add the item (such as local only, cloud only or both).

cancellationToken
CancellationToken

Cancellation token to monitor.

Returns

CacheKey that represents the item, that you can store in a CacheContainer.

Exceptions

Thrown when caller has no write permissions.

Applies to