Class SingleValueObject<T>
- Namespace
- Savvyio.Domain
- Assembly
- Savvyio.Domain.dll
Provides an implementation of ValueObject tailored for handling a single value.
public abstract class SingleValueObject<T> : ValueObject, IEquatable<ValueObject>, IEquatable<SingleValueObject<T>>
Type Parameters
T
The type of the object.
- Inheritance
-
ObjectSingleValueObject<T>
- Implements
-
IEquatable<ValueObject>IEquatable<SingleValueObject<T>>
- 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 sealed override IEnumerable<object> GetEqualityComponents()
Returns
- IEnumerable<Object>
An System.Collections.Generic.IEnumerable<T> that contains the equality components of this instance.
Operators
Implicit(SingleValueObject<T> to 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
.