Esempio n. 1
0
        private Expression BindSelect(Type resultType, Expression source, LambdaExpression selector)
        {
            ProjectionExpression projection = (ProjectionExpression)this.Visit(source);

            this.map[selector.Parameters[0]] = projection.Projector;
            Expression       expression = this.Visit(selector.Body);
            string           alias      = this.GetNextAlias();
            ProjectedColumns pc         = this.ProjectColumns(expression, alias, GetExistingAlias(projection.Source));

            return(new ProjectionExpression(
                       new SelectExpression(resultType, alias, pc.Columns, projection.Source, null),
                       pc.Projector
                       ));
        }
Esempio n. 2
0
        private Expression BindWhere(Type resultType, Expression source, LambdaExpression predicate)
        {
            ProjectionExpression projection = (ProjectionExpression)this.Visit(source);

            this.map[predicate.Parameters[0]] = projection.Projector;
            Expression where = this.Visit(predicate.Body);
            string           alias = this.GetNextAlias();
            ProjectedColumns pc    = this.ProjectColumns(projection.Projector, alias, GetExistingAlias(projection.Source));

            return(new ProjectionExpression(
                       new SelectExpression(resultType, alias, pc.Columns, projection.Source, where),
                       pc.Projector
                       ));
        }