Esempio n. 1
0
        public bool TryMatch(MethodCallExpression expression, ExpressionVisitor selectorVisitor,
                             out ResultOperatorBase op)
        {
            if (expression.Method.Name == nameof(TransformExtensions.TransformToJson))
            {
                var transformName = (string)expression.Arguments.Last().As <ConstantExpression>().Value;
                op = new TransformToJsonResultOperator(transformName);
                return(true);
            }

            op = null;
            return(false);
        }
Esempio n. 2
0
        public TransformToJsonNode(MethodCallExpressionParseInfo parseInfo, Expression transform, Expression optionalSelector) : base(parseInfo, transform as LambdaExpression, optionalSelector as LambdaExpression)
        {
            var name = transform.As <ConstantExpression>().Value.As <string>();

            _operator = new TransformToJsonResultOperator(name);
        }