예제 #1
0
        protected override Expression VisitEntity(EntryExpression entity)
        {
            ScopedDictionary <MemberInfo, bool> save = includeScope;

            includeScope = new ScopedDictionary <MemberInfo, bool>(includeScope);
            try {
                if (mapper.HasIncludedMembers(entity))
                {
                    entity = mapper.IncludeMembers(entity, m => {
                        if (includeScope.ContainsKey(m))
                        {
                            return(false);
                        }
                        if (policy.IsIncluded(m))
                        {
                            includeScope.Add(m, true);
                            return(true);
                        }
                        return(false);
                    });
                }
                return(base.VisitEntity(entity));
            }
            finally {
                includeScope = save;
            }
        }
예제 #2
0
 protected EntryExpression UpdateEntity(EntryExpression entity, Expression expression)
 {
     if (expression != entity.Expression)
     {
         return(new EntryExpression(entity.Entry, expression));
     }
     return(entity);
 }
예제 #3
0
 protected override Expression VisitEntity(EntryExpression entity)
 {
     if (this.entity == null)
     {
         this.entity = entity.Entry;
     }
     return(entity);
 }
예제 #4
0
 protected virtual bool CompareEntity(EntryExpression x, EntryExpression y)
 {
     return(x.Entry == y.Entry && Compare(x.Expression, y.Expression));
 }
예제 #5
0
        protected virtual Expression VisitEntity(EntryExpression entity)
        {
            Expression exp = Visit(entity.Expression);

            return(UpdateEntity(entity, exp));
        }
예제 #6
0
 /// <summary>
 /// </summary>
 /// <returns> </returns>
 public abstract bool HasIncludedMembers(EntryExpression entity);
예제 #7
0
 /// <summary>
 /// Recreate the type projection with the additional members included
 /// </summary>
 /// <param name="entity"> </param>
 /// <param name="fnIsIncluded"> </param>
 /// <returns> </returns>
 public abstract EntryExpression IncludeMembers(EntryExpression entity, Func <MemberInfo, bool> fnIsIncluded);
예제 #8
0
 protected override Expression VisitEntity(EntryExpression entity)
 {
     return(Visit(entity.Expression));
 }
예제 #9
0
 protected virtual Expression VisitEntity(EntryExpression entity)
 {
     Visit(entity.Expression);
     return(entity);
 }