Interface IValueObjectNormalizer<TValue>
Namespace: AdCodicem.ValueObjects
Assembly: AdCodicem.ValueObjects.Abstractions.dll
Declares that a value object normalizes its underlying value before validating it.
public interface IValueObjectNormalizer<TValue>
Type Parameters
TValue
Underlying value type.
Remarks
Implement this to give a value object a normalization rule: an IBAN without its separators and upper-cased,
a phone number carrying its country code. The generator calls Normalize member of
Normalization must be idempotent and must never reject: normalizing an already normalized value returns it
unchanged, and a value that cannot be normalized is rejected by
Methods
NormalizeValue(TValue)
Puts a value into its canonical form.
public static abstract TValue NormalizeValue(TValue value)
Parameters
value TValue
Value to normalize. Never null.
Returns
TValue
The canonical form of the value.