Skip to content

@)}

OptionExtensions.ValueOrDefault(Optional) method

Defined in

Type: OptionExtensions Namespace: DynamicData.Kernel Assembly: DynamicData.dll

Applies to

net10.0, netstandard2.0

public static T? ValueOrDefault<T>(this in Optional<T> source) where T : notnull

View source

Summary: Returns the value if the optional has a value, otherwise returns the default value of T.

Type parameters

NameDescription
TThe type of the item.

Parameters

NameTypeDescription
in source[Optional](#The source.

Returns: T? -- The value or default.