Struct Optional<T>
Represents an optional value.
public struct Optional<T>
Type Parameters
T
- Inherited Members
Properties
HasValue
Checks if a value is present.
public bool HasValue { get; }
Property Value
Value
public T Value { get; }
Property Value
- T
Methods
ValueOr(T)
Returns the existing value if present, and otherwise an alternative value.
public T ValueOr(T alternative)
Parameters
alternativeTThe alternative value.
Returns
- T
The existing or alternative value.