CacheExtensions.Set Method

Definition

Overloads

Set<TItem>(IMemoryCache, Object, TItem)
Set<TItem>(IMemoryCache, Object, TItem, MemoryCacheEntryOptions)
Set<TItem>(IMemoryCache, Object, TItem, IChangeToken)
Set<TItem>(IMemoryCache, Object, TItem, DateTimeOffset)
Set<TItem>(IMemoryCache, Object, TItem, TimeSpan)

Set<TItem>(IMemoryCache, Object, TItem)

public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
 static TItem Set(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, TItem value);
public static TItem Set<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value);
static member Set : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * 'Item -> 'Item
<Extension()>
Public Function Set(Of TItem) (cache As IMemoryCache, key As Object, value As TItem) As TItem

Type Parameters

TItem

Parameters

cache
IMemoryCache
key
Object
value
TItem

Returns

TItem

Set<TItem>(IMemoryCache, Object, TItem, MemoryCacheEntryOptions)

public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
 static TItem Set(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, TItem value, Microsoft::Extensions::Caching::Memory::MemoryCacheEntryOptions ^ options);
public static TItem Set<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions options);
static member Set : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * 'Item * Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions -> 'Item
<Extension()>
Public Function Set(Of TItem) (cache As IMemoryCache, key As Object, value As TItem, options As MemoryCacheEntryOptions) As TItem

Type Parameters

TItem

Parameters

cache
IMemoryCache
key
Object
value
TItem

Returns

TItem

Set<TItem>(IMemoryCache, Object, TItem, IChangeToken)

public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
 static TItem Set(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, TItem value, Microsoft::Extensions::Primitives::IChangeToken ^ expirationToken);
public static TItem Set<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, Microsoft.Extensions.Primitives.IChangeToken expirationToken);
static member Set : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * 'Item * Microsoft.Extensions.Primitives.IChangeToken -> 'Item
<Extension()>
Public Function Set(Of TItem) (cache As IMemoryCache, key As Object, value As TItem, expirationToken As IChangeToken) As TItem

Type Parameters

TItem

Parameters

cache
IMemoryCache
key
Object
value
TItem
expirationToken
IChangeToken

Returns

TItem

Set<TItem>(IMemoryCache, Object, TItem, DateTimeOffset)

public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
 static TItem Set(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, TItem value, DateTimeOffset absoluteExpiration);
public static TItem Set<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, DateTimeOffset absoluteExpiration);
static member Set : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * 'Item * DateTimeOffset -> 'Item
<Extension()>
Public Function Set(Of TItem) (cache As IMemoryCache, key As Object, value As TItem, absoluteExpiration As DateTimeOffset) As TItem

Type Parameters

TItem

Parameters

cache
IMemoryCache
key
Object
value
TItem
absoluteExpiration
DateTimeOffset

Returns

TItem

Set<TItem>(IMemoryCache, Object, TItem, TimeSpan)

public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
 static TItem Set(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, TItem value, TimeSpan absoluteExpirationRelativeToNow);
public static TItem Set<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, TItem value, TimeSpan absoluteExpirationRelativeToNow);
static member Set : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * 'Item * TimeSpan -> 'Item
<Extension()>
Public Function Set(Of TItem) (cache As IMemoryCache, key As Object, value As TItem, absoluteExpirationRelativeToNow As TimeSpan) As TItem

Type Parameters

TItem

Parameters

cache
IMemoryCache
key
Object
value
TItem
absoluteExpirationRelativeToNow
TimeSpan

Returns

TItem

Applies to