protected override Expression VisitUnary(UnaryExpression node) { var vis = new MappingSetterVisitor(); vis.Visit(node.Operand); this.MappingSetter = vis.MappingSetter; return(null); }
private MappingSetterDefinition GetMappingSetterDefinition(Expression argument, PropertyInfo propertyInfo) { MappingSetterVisitor vis = new MappingSetterVisitor(); vis.Visit(argument); MappingSetterDefinition mappingSetter = vis.MappingSetter; mappingSetter.TargetPropertyInfo = propertyInfo; return(mappingSetter); }
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)); }