NullableReadOnlySpanPairTFirst, TSecondGetValueOrElse Method

Returns the contained value, or the value returned by the specified function if there is no value.

Definition

Namespace: Ookii.Common
Assembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
C#
public ReadOnlySpanPair<TFirst, TSecond> GetValueOrElse(
	ReadOnlySpanPairFunc<TFirst, TSecond> defaultValueFunc
)

Parameters

defaultValueFunc  ReadOnlySpanPairFuncTFirst, TSecond
The function that produces a value if this NullableReadOnlySpanPairTFirst, TSecond is empty.

Return Value

ReadOnlySpanPairTFirst, TSecond
If the HasValue property is , the Value property; otherwise, the value returned by defaultValueFunc.

Remarks

The function defaultValueFunc is only called if the HasValue property is .

See Also