示例#1
0
 protected override void VisitMember(Context context, MemberExpression node)
 {
     if (node.MatchesProperty <string, int>(x => x.Length))
     {
         var projection = Projection.Create.Function(Function.Create.Length());
         context.State(projection);
         VisitMember(node, x => projection.Function.Length.Text = x);
     }
     else if (node.Expression != null && node.Expression.NodeType == ExpressionType.Parameter &&
              node.Member.DeclaringType == typeof(T))
     {
         if (node.Member.MemberType != MemberTypes.Property)
         {
             throw new MemberTypeNotSupportedException(node.Member.Name, node.Member.MemberType);
         }
         context.State(Projection.Create.Field(node.Member.Name, _tableAlias));
     }
     else
     {
         context.State(Projection.Create.Constant(node.EvaluateExpression()));
     }
 }