CacheExtensions.TryGetValue<TItem>(IMemoryCache, Object, TItem) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen anahtarla ilişkili değeri almaya çalışır.
public:
generic <typename TItem>
[System::Runtime::CompilerServices::Extension]
static bool TryGetValue(Microsoft::Extensions::Caching::Memory::IMemoryCache ^ cache, System::Object ^ key, [Runtime::InteropServices::Out] TItem % value);
public static bool TryGetValue<TItem> (this Microsoft.Extensions.Caching.Memory.IMemoryCache cache, object key, out TItem? value);
static member TryGetValue : Microsoft.Extensions.Caching.Memory.IMemoryCache * obj * 'Item -> bool
<Extension()>
Public Function TryGetValue(Of TItem) (cache As IMemoryCache, key As Object, ByRef value As TItem) As Boolean
Tür Parametreleri
- TItem
Alınacak nesnenin türü.
Parametreler
- cache
- IMemoryCache
Bu yöntemin IMemoryCache genişletir örneği.
- key
- Object
Alınacak değerin anahtarı.
- value
- TItem
Verilen anahtarla ilişkili değer.
Döndürülenler
true anahtar bulunduysa.
false Aksi takdir -de.