共用方式為


MemoryCacheEntryExtensions.AddExpirationToken 方法

定義

如果指定的 IChangeToken 過期,快取項目即過期。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ AddExpirationToken(Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ options, Microsoft::Extensions::Primitives::IChangeToken ^ expirationToken);
public static Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions AddExpirationToken (this Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options, Microsoft.Extensions.Primitives.IChangeToken expirationToken);
static member AddExpirationToken : Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions * Microsoft.Extensions.Primitives.IChangeToken -> Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions
<Extension()>
Public Function AddExpirationToken (options As MemoryCacheEntryOptions, expirationToken As IChangeToken) As MemoryCacheEntryOptions

參數

expirationToken
IChangeToken

導致快取項目過期的 IChangeToken

傳回

MemoryCacheEntryOptions,以便鏈結其他呼叫。

適用於