Coalesce()

ObjectExt::Coalesce(T0, T1) method

Implementation of ‘??’ operator translation for non-nullable types.

template<typename T0,typename T1> static auto System::ObjectExt::Coalesce(T0 value, T1 func)

Template parameters

ParameterDescription
T0LHS value type.
T1Type of lambda encapsulating RHS expression.

Arguments

ParameterTypeDescription
valueT0LHS value.
funcT1RHS expression.

Return Value

If LHS value is not null, returns LHS, otherwise calculates RHS expression and returns result.

ObjectExt::Coalesce(System::Nullable<T0>, T1) method

Implementation of ‘??’ operator translation for nullable types.

template<typename T0,typename T1> static T0 System::ObjectExt::Coalesce(System::Nullable<T0> value, T1 func)

Template parameters

ParameterDescription
T0LHS value type.
T1Type of lambda encapsulating RHS expression.

Arguments

ParameterTypeDescription
valueSystem::Nullable<T0>LHS value.
funcT1RHS expression.

Return Value

If LHS value is not null, returns LHS, otherwise calculates RHS expression and returns result.

See Also