แชร์ผ่าน


TurnContextStateCollection.Get Method

Definition

Overloads

Get<T>()

Gets the default value by type from the turn's context.

Get<T>(String)

Gets a cached value by name from the turn's context.

Get<T>()

Gets the default value by type from the turn's context.

public T Get<T> () where T : class;
member this.Get : unit -> 'T (requires 'T : null)
Public Function Get(Of T As Class) () As T

Type Parameters

T

The type of the object.

Returns

T

The object; or null if no default service of the type is registered.

Remarks

The default service key is the FullName of the object type.

Applies to

Get<T>(String)

Gets a cached value by name from the turn's context.

public T Get<T> (string key) where T : class;
member this.Get : string -> 'T (requires 'T : null)
Public Function Get(Of T As Class) (key As String) As T

Type Parameters

T

The type of the object.

Parameters

key
String

The name of the object.

Returns

T

The object; or null if no service is registered by the key, or the retrieved object does not match the object type.

Exceptions

key is null.

Applies to