//p=>p
        //p=>p.t
        //p=>p.Id
        protected override Expression VisitLambda <T>(Expression <T> node)
        {
            LambdaExpression lambda = node as LambdaExpression;

            if (lambda.Body.NodeType == ExpressionType.Parameter)
            {
                // expression like a=> a
                Type   type  = lambda.Body.Type;
                string alias = _aliases.GetTableAlias(lambda);
                this.VisitAllMember(type, alias);
                return(node);
            }

            if (lambda.Body.NodeType == ExpressionType.MemberAccess)
            {
                // expression like t=> t.a
                // => SELECT a.ClientId
                Type type = lambda.Body.Type;
                return(TypeUtils.IsPrimitive(type)
                    ? base.VisitLambda(node)
                    : this.VisitAllMember(type, _aliases.GetTableAlias(lambda.Body), node));
            }

            if (_mOnly)
            {
                _mOnly = false;
            }
            return(base.VisitLambda(node));
        }
        //遍历New表达式的参数集
        private Expression VisitAllArguments(NewExpression node)
        {
            for (int i = 0; i < node.Arguments.Count; i++)
            {
                Expression exp   = node.Arguments[i];
                Type       pType = exp.Type;

                if (exp.NodeType == ExpressionType.Parameter)
                {
                    // new Client(a)
                    Type   type  = exp.Type;
                    string alias = _aliases.GetTableAlias(exp);
                    this.VisitAllMember(type, alias);
                    continue;
                }

                if (exp.NodeType == ExpressionType.MemberAccess || exp.NodeType == ExpressionType.Call)
                {
                    if (TypeUtils.IsPrimitive(pType))
                    {
                        // new Client(a.ClientId)
                        this.Visit(exp);
                        // 选择字段
                        string newName = ColumnExpressionVisitor.AddColumn(_columns, node.Members != null ? node.Members[i].Name : (exp as MemberExpression).Member.Name);
                        // 添加字段别名
                        _builder.AppendAs(newName);
                        _builder.Append(',');
                        _builder.AppendNewLine();
                    }
                    else
                    {
                        this.VisitMember_Navigation(exp as MemberExpression);
                    }

                    continue;
                }

                throw new XfwException("NodeType '{0}' not supported.", exp.NodeType);
            }

            return(node);
        }
        //{new App() {Id = p.Id}}
        protected override Expression VisitMemberInit(MemberInitExpression node)
        {
            if (node.NewExpression != null)
            {
                this.VisitAllArguments(node.NewExpression);
            }

            if (_navDescriptorKeys.Count == 0)
            {
                _navDescriptorKeys.Add(node.Type.Name);
            }

            //todo #对 Bindings 进行排序,保证导航属性的赋值一定要最后面#
            // 未实现,在书写表达式时人工保证 ##

            for (int i = 0; i < node.Bindings.Count; i++)
            {
                MemberAssignment binding = node.Bindings[i] as MemberAssignment;
                if (binding == null)
                {
                    throw new XfwException("Only 'MemberAssignment' binding supported.");
                }

                Type pType    = (node.Bindings[i].Member as System.Reflection.PropertyInfo).PropertyType;
                bool visitNav = !TypeUtils.IsPrimitive(pType);

                #region 一般属性

                // 非导航属性
                if (!visitNav)
                {
                    base.VisitMemberBinding(node.Bindings[i]);

                    // 选择字段
                    string newName = ColumnExpressionVisitor.AddColumn(_columns, binding.Member.Name);
                    // 添加字段别名
                    _builder.AppendAs(newName);
                    _builder.Append(',');
                    _builder.AppendNewLine();

                    continue;
                }

                #endregion

                #region 导航属性

                int n = _navDescriptorKeys.Count;

                string keyName = _navDescriptorKeys.Count > 0 ? _navDescriptorKeys[_navDescriptorKeys.Count - 1] : string.Empty;
                keyName = !string.IsNullOrEmpty(keyName) ? keyName + "." + binding.Member.Name : binding.Member.Name;
                ColumnNavDescriptor descriptor = new ColumnNavDescriptor(keyName, binding.Member);

                if (!_navDescriptors.ContainsKey(keyName))
                {
                    descriptor.Start = _columns.Count;
                    descriptor.Count = CountField(binding.Expression);
                    _navDescriptors.Add(keyName, descriptor);
                    _navDescriptorKeys.Add(keyName);
                }

                if (binding.Expression.NodeType == ExpressionType.MemberAccess)
                {
                    this.VisitMember_Navigation(binding.Expression as MemberExpression);
                }
                else if (binding.Expression.NodeType == ExpressionType.New)
                {
                    this.VisitAllArguments(binding.Expression as NewExpression);
                }
                else if (binding.Expression.NodeType == ExpressionType.MemberInit)
                {
                    this.VisitMemberInit(binding.Expression as MemberInitExpression);
                }

                if (_navDescriptorKeys.Count != n)
                {
                    _navDescriptorKeys.RemoveAt(_navDescriptorKeys.Count - 1);
                }

                #endregion
            }

            return(node);
        }