Open sandboxFocus

Method TryGetValuePropertyGetter

TryGetValuePropertyGetter(Type, out Func<object, object?>?)

Gets a function that reads the Value property of a union.

Declaration
public static bool TryGetValuePropertyGetter(Type type, out Func<object, object?>? getter)
Parameters
Type Name Description
Type type

The type to evaluate.

Func<object, object> getter

When this method returns true, a function whose parameter is the union, boxed when it is a value type, and whose return value is the value of the case that the union currently carries; otherwise, null.

Returns
Type Description
bool

true if type is a union; otherwise, false.