Interface IValueObjectVisitor<TResult>
Namespace: AdCodicem.ValueObjects.Metadata
Assembly: AdCodicem.ValueObjects.Abstractions.dll
Receives the type arguments of a value object that a caller knows only by its descriptor, so that the caller closes its own generic code over them at compile time.
public interface IValueObjectVisitor<out TResult>
Type Parameters
TResult
What the visitor hands back: the adapter it built, a flag, a schema read off the type.
Remarks
new MyFormatter<TSelf, TValue>(), rather
than closing it with
Under native AOT, the compiler generates
A visitor needing context, a builder or a flag, holds it in fields. The calls happen at start-up, where creating a visitor per call costs nothing that matters.
Methods
Visit<TSelf, TValue>()
Receives the type arguments of the value object.
TResult Visit<TSelf, TValue>() where TSelf : struct, IValueObject<TSelf, TValue>
Returns
TResult
What the visitor builds for the value object.
Type Parameters
TSelf
The value object type.
TValue
Its underlying type.