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; } }
protected EntryExpression UpdateEntity(EntryExpression entity, Expression expression) { if (expression != entity.Expression) { return(new EntryExpression(entity.Entry, expression)); } return(entity); }
protected override Expression VisitEntity(EntryExpression entity) { if (this.entity == null) { this.entity = entity.Entry; } return(entity); }
protected virtual bool CompareEntity(EntryExpression x, EntryExpression y) { return(x.Entry == y.Entry && Compare(x.Expression, y.Expression)); }
protected virtual Expression VisitEntity(EntryExpression entity) { Expression exp = Visit(entity.Expression); return(UpdateEntity(entity, exp)); }
/// <summary> /// </summary> /// <returns> </returns> public abstract bool HasIncludedMembers(EntryExpression entity);
/// <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);
protected override Expression VisitEntity(EntryExpression entity) { return(Visit(entity.Expression)); }
protected virtual Expression VisitEntity(EntryExpression entity) { Visit(entity.Expression); return(entity); }