Interface IMarshaler<TSource, TTarget>
- Namespace
- PolyType
- Assembly
- PolyType.dll
Represents a bidirectional mapping between TSource and TTarget.
public interface IMarshaler<TSource, TTarget>
Type Parameters
TSourceThe source type from which we're marshaling.
TTargetThe target type to which we're marshaling.
Remarks
Implementations should form a bijection between TSource and TTarget,
meaning that chaining Marshal(TSource?) with Unmarshal(TTarget?) and vice versa should
always produce equal results.
Methods
Marshal(TSource?)
Maps an instance of TSource to TTarget.
TTarget? Marshal(TSource? value)
Parameters
valueTSourceThe input of type
TSource.
Returns
- TTarget
A value of type
TTargetcorresponding tovalue.
Unmarshal(TTarget?)
Maps an instance of TTarget back to TSource.
TSource? Unmarshal(TTarget? value)
Parameters
valueTTargetThe input of type
TTarget.
Returns
- TSource
A value of type
TSourcecorresponding tovalue.