public static IObjectMappingData ForElement <TSource, TTarget>( TSource source, TTarget target, int enumerableIndex, IObjectMappingData parent) { var mapperKey = new ElementObjectMapperKey(MappingTypes.For(source, target)); return(Create( source, target, enumerableIndex, mapperKey, parent)); }
public static ObjectMappingData <TSourceElement, TTargetElement> ForElement <TSourceElement, TTargetElement>( TSourceElement sourceElement, TTargetElement targetElement, int enumerableIndex, IObjectMappingDataUntyped parent) { var mapperKey = new ElementObjectMapperKey(MappingTypes <TSourceElement, TTargetElement> .Fixed); var mappingData = CreateMappingData(sourceElement, targetElement, enumerableIndex, mapperKey, parent); if (ChildMappersNeeded(mappingData.Parent)) { mappingData.SetMapper( GetParentMappingData(mappingData).MapperData.ChildMapperDatas.First().Mapper); } return(mappingData); }
public static ObjectMappingData <TSourceElement, TTargetElement> ForElement <TSourceElement, TTargetElement>( TSourceElement sourceElement, TTargetElement targetElement, int enumerableIndex, IObjectMappingDataUntyped parent) { var mapperKey = new ElementObjectMapperKey(MappingTypes.Fixed <TSourceElement, TTargetElement>()); var mappingDataParent = (IObjectMappingData)parent; return(new ObjectMappingData <TSourceElement, TTargetElement>( sourceElement, targetElement, enumerableIndex, mapperKey, mappingDataParent.MappingContext, mappingDataParent)); }
public static ObjectMappingData <TSourceElement, TTargetElement> ForElement <TSourceElement, TTargetElement>( TSourceElement sourceElement, TTargetElement targetElement, int elementIndex, object elementKey, IObjectMappingDataUntyped parent) { var mapperKey = new ElementObjectMapperKey(MappingTypes <TSourceElement, TTargetElement> .Fixed); var mappingData = CreateMappingData(sourceElement, targetElement, elementIndex, elementKey, mapperKey, parent); if (mappingData.SubMappingNeeded(out var parentMappingData)) { mappingData.SetMapper( parentMappingData.MapperData.ChildMapperDatas.First().Mapper); } return(mappingData); }