NullableReadOnlySpanTGetValueOrElse 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 ReadOnlySpan<T> GetValueOrElse(
	ReadOnlySpanFunc<T> defaultValueFunc
)

Parameters

defaultValueFunc  ReadOnlySpanFuncT
The function that produces a value if this NullableReadOnlySpanT is empty.

Return Value

ReadOnlySpanT
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