Logo Deedle

OptionalValueExtensions Type

Extension methods for working with optional values from C#. These make it easier to provide default values and convert optional values to `Nullable` (when the contained value is value type)

Static members

Static member Description

OptionalValueExtensions.AsNullable(opt)

Full Usage: OptionalValueExtensions.AsNullable(opt)

Parameters:
Returns: Nullable<'T>
Type parameters: 'T (requires (new : unit -> 'T) and struct and :> System.ValueType)

Extension method that converts optional value containing a value type to a C# friendly `Nullable` or `T?` type.

opt : OptionalValue<'T>
Returns: Nullable<'T>

OptionalValueExtensions.OrDefault(opt, defaultValue)

Full Usage: OptionalValueExtensions.OrDefault(opt, defaultValue)

Parameters:
Returns: 'T
Type parameters: 'T

Extension method that returns value in the specified optional value or the provided default value (the second argument).

opt : OptionalValue<'T>
defaultValue : 'T
Returns: 'T

Type something to start searching.