Share via


AgentState.GetValue<T>(String, Func<T>) Method

Definition

Get a property value.

public T GetValue<T>(string name, Func<T> defaultValueFactory = default);
abstract member GetValue : string * Func<'T> -> 'T
override this.GetValue : string * Func<'T> -> 'T
Public Function GetValue(Of T) (name As String, Optional defaultValueFactory As Func(Of T) = Nothing) As T

Type Parameters

T

Parameters

name
String

The name of the property.

defaultValueFactory
Func<T>

Defines the default value. Invoked when no value been set for the requested state property. If defaultValueFactory is defined as null in that case, the method returns null.

Returns

T

Implements

Applies to