While searching for a match between source and target, MappingGenerator always uses case-insensitive comparison mode. Additionally, all underscore characters are removed from the names before the comparison. To find a best match the following matching strategies are executed in order:
Direct mapping When property/field names match directly:
target.FirstName = source.FirstName;
target.LastName = source.LastName;
Mapping Method Call-To-Property When method name ends with target name:
target.Total = source.GetTotal()
Flattening with sub-property When the path matches the target name:
target.UnitId = source.Unit.Id
Expanding acronyms
UserName = u.Name
⭐ Flattening
When sub-property name matches the target name:
City = s.MainAddress.City
This strategy is used when the Allow for type flattening
option is enabled (available only in paid version).
⭐ Congruent matching
Trying to match a source to target as a prefix or suffix like t.X = s.XSuffix)
City = s.CityValue
This strategy is used when the Allow for congruent matching
option is enabled (available only in paid version).