MemoryVariableStore.TryGetValue(string,T?)

Method in MemoryVariableStore

Summary

Given a variable name, attempts to fetch a value for the variable, either from storage, initial values found in Program , or by evaluating a smart variable found in Program .

public virtual bool TryGetValue<T>(string variableName, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T? result)

Parameters

NameDescription
string variableNameThe name of the variable.
T resultIf this method returns true , this parameter will contain the fetched value.

Type Parameters

NameDescription
TThe type of the value to return. The fetched value will be converted to this type, if possible.

Returns

true if a value could be fetched; false otherwise.