Class SingleValueObject<T>
Provides an implementation of ValueObject tailored for handling a single value.
public abstract record SingleValueObject<T> : ValueObject, IEquatable<ValueObject>, IEquatable<SingleValueObject<T>>
Type Parameters
T
The type of the object.
- Inheritance
-
objectSingleValueObject<T>
- Implements
- Inherited Members
Constructors
SingleValueObject(T)
Initializes a new instance of the SingleValueObject<T> class.
protected SingleValueObject(T value)
Parameters
value
TThe value to associate to Value.
Properties
Value
Gets the value of this instance.
public T Value { get; }
Property Value
- T
The value of this instance.
Methods
GetEqualityComponents()
Gets the equality components of this instance.
protected override sealed IEnumerable<object> GetEqualityComponents()
Returns
- IEnumerable<object>
An IEnumerable<T> that contains the equality components of this instance.
Operators
implicit operator T(SingleValueObject<T>)
Performs an implicit conversion from SingleValueObject<T> to T
.
public static implicit operator T(SingleValueObject<T> value)
Parameters
value
SingleValueObject<T>The value to convert.
Returns
- T
T
that is equivalent tovalue
.