DistributedCacheExtensions.SetAsync 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
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)
지정된 키로 지정된 캐시의 바이트 시퀀스를 비동기적으로 설정합니다.
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[])된 예외를 참조하세요.
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기