예제 #1
0
            protected override Expression VisitUnary(UnaryExpression node)
            {
                var vis = new MappingSetterVisitor();

                vis.Visit(node.Operand);
                this.MappingSetter = vis.MappingSetter;
                return(null);
            }
예제 #2
0
        private MappingSetterDefinition GetMappingSetterDefinition(Expression argument, PropertyInfo propertyInfo)
        {
            MappingSetterVisitor vis = new MappingSetterVisitor();

            vis.Visit(argument);
            MappingSetterDefinition mappingSetter = vis.MappingSetter;

            mappingSetter.TargetPropertyInfo = propertyInfo;
            return(mappingSetter);
        }
예제 #3
0
        protected override MemberAssignment VisitMemberAssignment(MemberAssignment node)
        {
            var vis = new UnaryMapping();

            vis.Visit(node.Expression);
            if (vis.MappingSetter != null)
            {
                vis.MappingSetter.TargetPropertyInfo = node.Member as PropertyInfo;
                MappingSetters.Add(vis.MappingSetter);
            }
            else
            {
                var vis2 = new MappingSetterVisitor();
                vis2.Visit(node.Expression);
                vis2.MappingSetter.TargetPropertyInfo = node.Member as PropertyInfo;
                MappingSetters.Add(vis2.MappingSetter);
            }
            return(base.VisitMemberAssignment(node));
        }