Optional<T> structure
Represents an optional value.
public struct Optional<T> : IEquatable<Optional>, IOptional
| parameter |
description |
| T |
The type of the optional value. |
Public Members
| name |
description |
| Optional(…) |
Initializes a new instance of the Optional{T} structure to the specified value. |
| HasValue { get; } |
Gets a value indicating whether the current Optional{T} object has a value. |
| Value { get; } |
Gets the value of the current Optional{T} value. |
| override Equals(…) |
Indicates whether the current object is equal to another object of the same type. |
| Equals(…) |
|
| override GetHashCode() |
Retrieves the hash code of the object returned by the Value property. |
| GetValueOrDefault() |
Retrieves the value of the current Optional{T} object, or the object’s default value. |
| GetValueOrDefault(…) |
Retrieves the value of the current Optional{T} object, or the specified default value. |
| override ToString() |
Returns the text representation of the value of the current Optional{T} object. |
| operator == |
|
| explicit operator |
|
| implicit operator |
|
| operator != |
|
See Also