CacheExtensions.GetOrCreate<TItem> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
static TItem GetOrCreate(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, Func<Microsoft::Extensions::Caching::Memory::ICacheEntry ^, TItem> ^ factory);
public static TItem GetOrCreate<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, Func<Microsoft.Extensions.Caching.Memory.ICacheEntry,TItem> factory);
public static TItem? GetOrCreate<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, Func<Microsoft.Extensions.Caching.Memory.ICacheEntry,TItem> factory);
static member GetOrCreate : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * Func<Microsoft.Extensions.Caching.Memory.ICacheEntry, 'Item> -> 'Item
<Extension()>
Public Function GetOrCreate(Of TItem) (cache As IMemoryCache, key As Object, factory As Func(Of ICacheEntry, TItem)) As TItem
Type Parameters
- TItem
Parameters
- cache
- IMemoryCache
- key
- Object
- factory
- Func<ICacheEntry,TItem>
Returns
- TItem