MappingConversionType
A MappingConversionType represents a type of conversion
how one type can be converted into another.
All = -1
Enables all supported conversions.
Constructor = 1
Use the constructor of the target type,
which accepts the source type as a single parameter.
DateTimeToDateOnly = 256
If the source is a DateTime
and the target is a DateOnly
uses the `FromDateTime` method on the target type with the source as single parameter.
DateTimeToTimeOnly = 512
If the source is a DateTime
and the target is a TimeOnly
uses the `FromDateTime` method on the target type with the source as single parameter.
Dictionary = 4096
If the source and targets are IDictionary<T, U>
or IReadOnlyDictionary<T, U>.
Maps each KeyValuePair<T, U> individually.
Enumerable = 2048
If the source and the target is an IEnumerable<T>
Maps each element individually.
EnumToEnum = 128
If the source is an Enum
and the target is another Enum,
map it according to the EnumMappingStrategy.
EnumToString = 64
If the source is an Enum
and the target is a String,
uses the name of the enum member to convert it to a string.
ExplicitCast = 4
An explicit cast from the source type to the target type.
ImplicitCast = 2
An implicit cast from the source type to the target type.
None = 0
None.
ParseMethod = 8
If the source type is a String,
uses a a static visible method named `Parse` on the target type
with a return type equal to the target type and a string as single parameter.
Queryable = 1024
If the source and the target is a IQueryable<T>.
Only uses object initializers and inlines the mapping code.
StringToEnum = 32
If the target is an Enum
and the source is a String,
parses the string to match the name of an enum member.
ToStringMethod = 16
If the target type is a String,
uses the `ToString` method on the source type.