Exemple #1
0
        private Expression GetPopulation(
            IPopulationLoopData loopData,
            QualifiedMember dictionaryEntryMember,
            IObjectMappingData dictionaryMappingData)
        {
            var elementMapping = loopData.GetElementMapping(dictionaryMappingData);

            return(GetPopulation(elementMapping, dictionaryEntryMember, dictionaryMappingData));
        }
        private Expression GetPopulation(
            IPopulationLoopData loopData,
            DictionaryTargetMember dictionaryEntryMember,
            IObjectMappingData dictionaryMappingData)
        {
            var elementMapping = loopData.GetElementMapping(dictionaryMappingData);

            if (dictionaryEntryMember.HasKey &&
                dictionaryEntryMember.CheckExistingElementValue &&
                dictionaryMappingData.MapperData.TargetCouldBePopulated())
            {
                elementMapping = elementMapping.Replace(
                    dictionaryMappingData.MapperData.GetTargetMemberDictionaryKey(),
                    dictionaryEntryMember.Key,
                    ExpressionEvaluation.Equivalator);
            }

            return(GetPopulation(elementMapping, dictionaryEntryMember, dictionaryMappingData));
        }