Пример #1
0
        protected override Expression VisitMethodCall(MethodCallExpression node)
        {
            if (!node.IsConstant())
            {
                switch (node.Method.Name)
                {
                case "Contains":
                    ParseMethodContains(node);
                    break;

                case "Count":
                    ParseMethodCount(node);
                    break;

                case "Max":
                    ParseMethodMax(node);
                    break;
                }
            }
            else
            {
                var objectMember = Expression.Convert(node, typeof(object));
                var getterLambda = Expression.Lambda <Func <object> >(objectMember);
                var getter       = getterLambda.Compile()();
                this.Column = new ParameterColumn(this.Context.AddParameter(getter))
                {
                    Type = node.Type
                };
            }
            return(node);
        }