Class NullableEx<T>
Represents a wrapper for nullable types that can be serialized.
[DataContract]
public class NullableEx<T> : Equatable<NullableEx<T>>, ICloneable<NullableEx<T>>, ICloneable, IEquatable<NullableEx<T>>, IComparable<NullableEx<T>>, IComparable
Type Parameters
T
The underlying type of the nullable value.
- Inheritance
-
Cloneable<NullableEx<T>>Equatable<NullableEx<T>>NullableEx<T>
- Implements
-
ICloneable<NullableEx<T>>IEquatable<NullableEx<T>>
- Inherited Members
- Extension Methods
Constructors
NullableEx()
public NullableEx()
Properties
HasValue
Gets a value indicating whether the current NullableEx object has a valid value.
public bool HasValue { get; }
Property Value
Value
Gets or sets the value of the current NullableEx object.
[DataMember]
public T Value { get; set; }
Property Value
- T
Exceptions
- InvalidOperationException
The HasValue property is false.
Methods
Clone()
Creates a new object that is a copy of the current instance.
public override NullableEx<T> Clone()
Returns
- NullableEx<T>
A new object that is a copy of this instance.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
OnEquals(NullableEx<T>)
Determines equality between this instance and another instance of the same type.
protected override bool OnEquals(NullableEx<T> other)
Parameters
other
NullableEx<T>An object to compare with this instance.
Returns
- bool
true if the objects are equal; otherwise, false.