public interface INullableValue
mscorlib
BCL
Supported by types that either have a value or an indication of the absence of a value.
An object that supports the INullableValue interface can be tested via the property System.INullableValue.HasValue to see if that object currently contains a value. If it does, that value can be retrieved via the property System.INullableValue.Value. Otherwise, that object contains no value.
System Namespace
INullableValue Properties
INullableValue.HasValue Property
INullableValue.Value Property
bool HasValue { get; }
Indicates whether the current instance contains a value.
true
if the current instance contains a value; otherwisefalse
.
[Behaviors: If System.INullableValue.HasValue istrue
, the instance contains a value, and System.INullableValue.Value returns that value.If System.INullableValue.HasValue is
false
, the instance contains no value, and an attempt to read System.INullableValue.Value results in a InvalidOperationException.This property is read-only.
]
System.INullableValue Interface, System Namespace
object Value { get; }
Gets the value, if any, of the current instance.
The value of the current instance.
Exception Type Condition System.InvalidOperationException System.INullableValue.HasValue is false
.
[Behaviors: If System.INullableValue.HasValue istrue
, the instance contains a value, and System.INullableValue.Value returns that value.If System.INullableValue.HasValue is
false
, the instance contains no value, and an attempt to read System.INullableValue.Value results in a InvalidOperationException.This property is read-only.
]
System.INullableValue Interface, System Namespace