TurnContextStateCollection.Get Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
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.