示例#1
0
        public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable <Expression> arguments)
        {
            var source = BinderHelper.BindSelect(
                pipeline,
                bindingContext,
                ExpressionHelper.GetLambda(arguments.Single()));

            var serializer = bindingContext.GetSerializer(source.Selector.Type, source.Selector);

            return(new PipelineExpression(
                       source,
                       new DocumentExpression(serializer)));
        }
示例#2
0
        public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable <Expression> arguments)
        {
            var source = pipeline.Source;

            if (arguments.Any())
            {
                source = BinderHelper.BindSelect(
                    pipeline,
                    bindingContext,
                    ExpressionHelper.GetLambda(arguments.Single()));
            }

            return(new PipelineExpression(
                       source,
                       pipeline.Projector,
                       new MinResultOperator(node.Type)));
        }
示例#3
0
        public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable <Expression> arguments)
        {
            var source = pipeline.Source;

            if (arguments.Any())
            {
                source = BinderHelper.BindSelect(
                    pipeline,
                    bindingContext,
                    ExpressionHelper.GetLambda(arguments.Single()));
            }

            return(new PipelineExpression(
                       source,
                       pipeline.Projector,
                       new StandardDeviationResultOperator(
                           node.Type,
                           bindingContext.GetSerializer(node.Type, node),
                           node.Method.Name == nameof(MongoEnumerable.StandardDeviationSample))));
        }