A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.memory.cacheextensions.set below:

CacheExtensions.Set Method (Microsoft.Extensions.Caching.Memory) | Microsoft Learn

CacheExtensions.Set Method Definition Overloads Set<TItem>(IMemoryCache, Object, TItem)

Associate a value with a key in the IMemoryCache.

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

Sets a cache entry with the given key and value and apply the values of an existing MemoryCacheEntryOptions to the created entry.

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

Sets a cache entry with the given key and value that will expire when IChangeToken expires.

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

Sets a cache entry with the given key and value that will expire in the given duration.

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

Sets a cache entry with the given key and value that will expire in the given duration from now.

Set<TItem>(IMemoryCache, Object, TItem)
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs
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

The type of the object to set.

Parameters
key
Object

The key of the entry to set.

value
TItem

The value to associate with the key.

Returns

TItem

The value that was set.

Set<TItem>(IMemoryCache, Object, TItem, MemoryCacheEntryOptions)
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs

Sets a cache entry with the given key and value and apply the values of an existing MemoryCacheEntryOptions to the created entry.

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

The type of the object to set.

Parameters
key
Object

The key of the entry to set.

value
TItem

The value to associate with the key.

Returns

TItem

The value that was set.

Set<TItem>(IMemoryCache, Object, TItem, IChangeToken)
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs

Sets a cache entry with the given key and value that will expire when IChangeToken expires.

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

The type of the object to set.

Parameters
key
Object

The key of the entry to set.

value
TItem

The value to associate with the key.

Returns

TItem

The value that was set.

Set<TItem>(IMemoryCache, Object, TItem, DateTimeOffset)
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs

Sets a cache entry with the given key and value that will expire in the given duration.

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

The type of the object to set.

Parameters
key
Object

The key of the entry to set.

value
TItem

The value to associate with the key.

absoluteExpiration
DateTimeOffset

The point in time at which the cache entry will expire.

Returns

TItem

The value that was set.

Set<TItem>(IMemoryCache, Object, TItem, TimeSpan)
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs
Source:
MemoryCacheExtensions.cs

Sets a cache entry with the given key and value that will expire in the given duration from now.

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

The type of the object to set.

Parameters
key
Object

The key of the entry to set.

value
TItem

The value to associate with the key.

absoluteExpirationRelativeToNow
TimeSpan

The duration from now after which the cache entry will expire.

Returns

TItem

The value that was set.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4