Example #1
0
        internal static IPropertyMapConfiguration Create(LambdaExpression destination, LambdaExpression source)
        {
            if (destination == null || !destination.IsMemberPath())
            {
                return(null);
            }
            var reversed = new PathConfigurationExpression <TSource, TDestination, object>(destination);

            if (reversed.MemberPath.Length == 1)
            {
                var reversedMemberExpression = new MemberConfigurationExpression <TSource, TDestination, object>(reversed.DestinationMember, typeof(TSource));
                reversedMemberExpression.MapFromUntyped(source);
                return(reversedMemberExpression);
            }
            reversed.MapFromUntyped(source);
            return(reversed);
        }
 public IPropertyMapConfiguration Reverse() =>
 PathConfigurationExpression <TDestination, TSource, object> .Create(_sourceMember, GetDestinationExpression());