DistributedCacheExtensions.SetAsync 메서드

정의

오버로드

SetAsync(IDistributedCache, String, Byte[])

지정된 키로 지정된 캐시의 바이트 시퀀스를 비동기적으로 설정합니다.

SetAsync(IDistributedCache, String, Byte[], CancellationToken)

지정된 키로 지정된 캐시의 바이트 시퀀스를 비동기적으로 설정합니다.

SetAsync(IDistributedCache, String, Byte[])

지정된 키로 지정된 캐시의 바이트 시퀀스를 비동기적으로 설정합니다.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ SetAsync(Microsoft::Extensions::Caching::Distributed::IDistributedCache ^ cache, System::String ^ key, cli::array <System::Byte> ^ value);
public static System.Threading.Tasks.Task SetAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value);
static member SetAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * byte[] -> System.Threading.Tasks.Task
<Extension()>
Public Function SetAsync (cache As IDistributedCache, key As String, value As Byte()) As Task

매개 변수

cache
IDistributedCache

데이터를 저장할 캐시입니다.

key
String

데이터를 저장할 키입니다.

value
Byte[]

캐시에 저장할 데이터입니다.

반환

비동기 집합 작업을 나타내는 태스크입니다.

예외

key 또는 value가 null입니다.

설명

이 메서드는 메서드의 동기 대응에서 throw할 수 있는 모든 비사용 예외를 반환하는 태스크에 저장됩니다. 예외가 반환된 작업에 저장되면 작업이 대기될 때 해당 예외가 throw됩니다. 와 같은 ArgumentException사용 예외는 여전히 동기적으로 throw됩니다. 저장된 예외는 에서 throw Set(IDistributedCache, String, Byte[])된 예외를 참조하세요.

적용 대상

SetAsync(IDistributedCache, String, Byte[], CancellationToken)

Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs
Source:
DistributedCacheExtensions.cs

지정된 키로 지정된 캐시의 바이트 시퀀스를 비동기적으로 설정합니다.

public static System.Threading.Tasks.Task SetAsync (this Microsoft.Extensions.Caching.Distributed.IDistributedCache cache, string key, byte[] value, System.Threading.CancellationToken token = default);
static member SetAsync : Microsoft.Extensions.Caching.Distributed.IDistributedCache * string * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SetAsync (cache As IDistributedCache, key As String, value As Byte(), Optional token As CancellationToken = Nothing) As Task

매개 변수

cache
IDistributedCache

데이터를 저장할 캐시입니다.

key
String

데이터를 저장할 키입니다.

value
Byte[]

캐시에 저장할 데이터입니다.

token
CancellationToken

선택 사항입니다. 작업을 취소하는 CancellationToken입니다.

반환

비동기 집합 작업을 나타내는 태스크입니다.

예외

key 또는 value가 null입니다.

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

설명

이 메서드는 메서드의 동기 대응에서 throw할 수 있는 모든 비사용 예외를 반환하는 태스크에 저장됩니다. 예외가 반환된 작업에 저장되면 작업이 대기될 때 해당 예외가 throw됩니다. 와 같은 ArgumentException사용 예외는 여전히 동기적으로 throw됩니다. 저장된 예외는 에서 throw Set(IDistributedCache, String, Byte[])된 예외를 참조하세요.

적용 대상