Click or drag to resize
OptionalValueT Structure
Value type that represents a potentially missing value. This is similar to `System.Nullable<T>`, but does not restrict the contained value to be a value type, so it can be used for storing values of any types. When obtained from `DataFrame<R, C>` or `Series<K, T>`, the `Value` will never be `Double.NaN` or `null` (but this is not, in general, checked when constructing the value). The type is only used in C#-friendly API. F# operations generally use expose standard F# `option<T>` type instead. However, there the `OptionalValue` module contains helper functions for using this type from F# as well as `Missing` and `Present` active patterns. [category:Primitive types and values]

Namespace:  Deedle
Assembly:  Deedle (in Deedle.dll) Version: 1.2
Syntax
C#
[SerializableAttribute]
public struct OptionalValue<T>

Type Parameters

T

The OptionalValueT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyHasValue
Gets a value indicating whether the current `OptionalValue<T>` has a value
Public propertyStatic memberMissing
Returns a new instance of `OptionalValue<T>` that does not contain a value.
Public propertyValue
Returns the value stored in the current `OptionalValue<T>`. Exceptions: `InvalidOperationException` - Thrown when `HasValue` is `false`.
Public propertyValueOrDefault
Returns the value stored in the current `OptionalValue<T>` or the default value of the type `T` when a value is not present.
Top
Methods
  NameDescription
Public methodEquals
Support structural equality
(Overrides ValueTypeEquals(Object).)
Public methodGetHashCode
Support structural equality
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Prints the value or "<null>" when the value is present, but is `null` or "<missing>" when the value is not present (`HasValue = false`).
(Overrides ValueTypeToString.)
Top
Extension Methods
  NameDescription
Public Extension MethodAsNullableT
Extension method that converts optional value containing a value type to a C# friendly `Nullable<T>` or `T?` type.
(Defined by OptionalValueExtensions.)
Public Extension MethodOrDefaultT
Extension method that returns value in the specified optional value or the provided default value (the second argument).
(Defined by OptionalValueExtensions.)
Top
See Also