コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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);
        }