CacheExtensions.TryGetValue<TItem>(IMemoryCache, Object, TItem) 메서드

정의

지정된 키와 연결된 값을 가져옵니다.

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);
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

형식 매개 변수

TItem

가져올 개체의 유형입니다.

매개 변수

cache
IMemoryCache

이 메서드가 IMemoryCache 확장되는 instance.

key
Object

가져올 값의 키입니다.

value
TItem

지정된 키와 연결된 값입니다.

반환

키가 있으면 true입니다. 그렇지 않으면 false입니다.

적용 대상