Share via


TransactionContext.TryGetValue<T>(Object, T) Method

Definition

Lookup the value associated with a specified key in the transaction context.

public:
generic <typename T>
 bool TryGetValue(System::Object ^ key, [Runtime::InteropServices::Out] T % value);
public bool TryGetValue<T> (object key, out T value);
member this.TryGetValue : obj * 'T -> bool
Public Function TryGetValue(Of T) (key As Object, ByRef value As T) As Boolean

Type Parameters

T

The expected type of the value associated with the specified key

Parameters

key
Object

The key to lookup in the context

value
T

Receives the value associated with the specified key, or the default value for T if the key is not found

Returns

Whether or not the context contained a value with the specified key.

Applies to