CacheExtensions.GetOrCreate<TItem> 方法

定義

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

類型參數

TItem

參數

cache
IMemoryCache
key
Object
factory
Func<ICacheEntry,TItem>

傳回

TItem

適用於