示例#1
0
        protected Expression VisitMListChildProjection(ChildProjectionExpression child, MemberExpression field)
        {
            Expression outer = Visit(child.OuterKey);

            if (outer != child.OuterKey)
            {
                child = new ChildProjectionExpression(child.Projection, outer, child.IsLazyMList, child.Type, child.Token);
            }

            return(Scope.LookupMList(row, child, field));
        }
示例#2
0
        protected internal override Expression VisitChildProjection(ChildProjectionExpression child)
        {
            Expression outer = Visit(child.OuterKey);

            if (outer != child.OuterKey)
            {
                child = new ChildProjectionExpression(child.Projection, outer, child.IsLazyMList, child.Type, child.Token);
            }

            return(Scope.LookupEager(row, child));
        }
示例#3
0
        protected internal override Expression VisitChildProjection(ChildProjectionExpression child)
        {
            var result = base.VisitChildProjection(child);

            if (!child.IsLazyMList)
            {
                list.Add(child);
            }

            return(result);
        }
    protected internal virtual Expression VisitChildProjection(ChildProjectionExpression child)
    {
        ProjectionExpression proj = (ProjectionExpression)this.Visit(child.Projection);
        Expression           key  = this.Visit(child.OuterKey);

        if (proj != child.Projection || key != child.OuterKey)
        {
            return(new ChildProjectionExpression(proj, key, child.IsLazyMList, child.Type, child.Token));
        }
        return(child);
    }
    protected internal override Expression VisitChildProjection(ChildProjectionExpression child)
    {
        Expression           key  = this.Visit(child.OuterKey);
        ProjectionExpression proj = (ProjectionExpression)UnusedColumnRemover.Remove(child.Projection);

        if (proj != child.Projection || key != child.OuterKey)
        {
            return(new ChildProjectionExpression(proj, key, child.IsLazyMList, child.Type, child.Token));
        }
        return(child);
    }
示例#6
0
    public static Expression LookupEager(Expression row, ChildProjectionExpression cProj)
    {
        if (cProj.IsLazyMList)
        {
            throw new InvalidOperationException("IsLazyMList not expected at this stage");
        }

        Type type = cProj.Projection.UniqueFunction == null?cProj.Type.ElementType() !: cProj.Type;

        MethodInfo mi = miLookup.MakeGenericMethod(cProj.OuterKey.Type, type);

        Expression call = Expression.Call(row, mi, Expression.Constant(cProj.Token), cProj.OuterKey);

        if (cProj.Projection.UniqueFunction != null)
        {
            throw new InvalidOperationException("Eager ChildProyection with UniqueFunction '{0}' not expected at this stage".FormatWith(cProj.Projection.UniqueFunction));
        }

        return(call);
    }
示例#7
0
    public static Expression LookupMList(Expression row, ChildProjectionExpression cProj, MemberExpression field)
    {
        if (!cProj.IsLazyMList)
        {
            throw new InvalidOperationException("Not IsLazyMList not expected at this stage");
        }

        if (!cProj.Type.IsMList())
        {
            throw new InvalidOperationException("Lazy ChildProyection of type '{0}' instead of MList".FormatWith(cProj.Type.TypeName()));
        }

        if (cProj.Projection.UniqueFunction != null)
        {
            throw new InvalidOperationException("Lazy ChildProyection with UniqueFunction '{0}'".FormatWith(cProj.Projection.UniqueFunction));
        }

        MethodInfo mi = miLookupRequest.MakeGenericMethod(cProj.OuterKey.Type, cProj.Type.ElementType() !);

        return(Expression.Call(row, mi, Expression.Constant(cProj.Token), cProj.OuterKey, field));
    }
 protected override Expression VisitChildProjection(ChildProjectionExpression child)
 {
     return child;
 }
 protected internal override Expression VisitChildProjection(ChildProjectionExpression child)
 {
     return(child);
 }
示例#10
0
 protected internal override Expression VisitChildProjection(ChildProjectionExpression child)
 {
     Expression key = this.Visit(child.OuterKey);
     ProjectionExpression proj = (ProjectionExpression)UnusedColumnRemover.Remove(child.Projection);
  
     if (proj != child.Projection || key != child.OuterKey)
     {
         return new ChildProjectionExpression(proj, key, child.IsLazyMList, child.Type, child.Token);
     }
     return child;
 }
示例#11
0
        protected virtual Expression VisitChildProjection(ChildProjectionExpression child)
        {
            ProjectionExpression proj = (ProjectionExpression)this.Visit(child.Projection);
            Expression key = this.Visit(child.OuterKey);

            if (proj != child.Projection || key != child.OuterKey)
            {
                return new ChildProjectionExpression(proj, key, child.IsLazyMList, child.Type, child.Token);
            }
            return child;
        }
示例#12
0
 protected override Expression VisitChildProjection(ChildProjectionExpression child)
 {
     throw InvalidSqlExpression(child);
 }