Esempio n. 1
0
        public IMappingExpression ReverseMap()
        {
            var reverseMap = new MappingExpression(new TypePair(Types.DestinationType, Types.SourceType), MemberList.Source);

            reverseMap.MemberConfigurations.AddRange(MemberConfigurations.Select(m => m.Reverse()).Where(m => m != null));
            ReverseMapExpression = reverseMap;
            return(reverseMap);
        }
Esempio n. 2
0
        public IMappingExpression ReverseMap()
        {
            var reversedTypes = new TypePair(DestinationType, SourceType);
            var reverseMap    = new MappingExpression(reversedTypes, MemberList.None)
            {
                IsReverseMap = true
            };

            ReverseMapCore(reverseMap);
            reverseMap.IncludeMembers(MapToSourceMembers().Select(m => m.DestinationMember.Name).ToArray());
            foreach (var includedMemberName in IncludedMembersNames)
            {
                reverseMap.ForMember(includedMemberName, m => m.MapFrom(s => s));
            }
            return(reverseMap);
        }
Esempio n. 3
0
        public IMappingExpression ReverseMap()
        {
            var reversedTypes = new TypePair(Types.DestinationType, Types.SourceType);
            var reverseMap    = new MappingExpression(reversedTypes, MemberList.None);

            if (!reversedTypes.IsGenericTypeDefinition)
            {
                reverseMap.MemberConfigurations.AddRange(MemberConfigurations.Select(m => m.Reverse()).Where(m => m != null));
            }
            ReverseMapExpression = reverseMap;
            reverseMap.IncludeMembers(MapToSourceMembers().Select(m => m.DestinationMember.Name).ToArray());
            foreach (var includedMemberName in IncludedMembersNames)
            {
                reverseMap.ForMember(includedMemberName, m => m.MapFrom(s => s));
            }
            return(reverseMap);
        }