Interface ITypeConverter<TSource, TDestination>
- Namespace
- ForgeMap
- Assembly
- ForgeMap.Abstractions.dll
Interface for custom type converters. Implement this for complex type transformations that cannot be expressed with ForgeFromAttribute.
public interface ITypeConverter<in TSource, out TDestination>
Type Parameters
TSourceThe source type to convert from.
TDestinationThe destination type to convert to.
Methods
Convert(TSource)
Converts a source object to a destination object.
TDestination Convert(TSource source)
Parameters
sourceTSourceThe source object to convert. Guaranteed to be non-null when called through generated ForgeMap code.
Returns
- TDestination
The converted destination object.