Esempio n. 1
0
        public override EntityExpression IncludeMembers(EntityExpression entity, Func <MemberInfo, bool> fnIsIncluded)
        {
            var  assignments = this.GetAssignments(entity.Expression).ToDictionary(ma => ma.Member.Name);
            bool anyAdded    = false;

            foreach (var mi in this.mapping.GetMappedMembers(entity.Entity))
            {
                EntityAssignment ea;
                bool             okayToInclude = !assignments.TryGetValue(mi.Name, out ea) || IsNullRelationshipAssignment(entity.Entity, ea);
                if (okayToInclude && fnIsIncluded(mi))
                {
                    ea = new EntityAssignment(mi, this.GetMemberExpression(entity.Expression, entity.Entity, mi));
                    assignments[mi.Name] = ea;
                    anyAdded             = true;
                }
            }
            if (anyAdded)
            {
                return(new EntityExpression(entity.Entity, this.BuildEntityExpression(entity.Entity, assignments.Values.ToList())));
            }
            return(entity);
        }
Esempio n. 2
0
 protected virtual Expression VisitEntity(EntityExpression entity)
 {
     this.Visit(entity.Expression);
     return(entity);
 }
Esempio n. 3
0
 /// <summary>
 /// </summary>
 /// <returns></returns>
 public abstract bool HasIncludedMembers(EntityExpression entity);
Esempio n. 4
0
 /// <summary>
 /// Recreate the type projection with the additional members included
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="fnIsIncluded"></param>
 /// <returns></returns>
 public abstract EntityExpression IncludeMembers(EntityExpression entity, Func <MemberInfo, bool> fnIsIncluded);
Esempio n. 5
0
 protected override Expression VisitEntity(EntityExpression entity)
 {
     return(this.Visit(entity.Expression));
 }
Esempio n. 6
0
        protected virtual Expression VisitEntity(EntityExpression entity)
        {
            var exp = this.Visit(entity.Expression);

            return(this.UpdateEntity(entity, exp));
        }
 protected virtual bool CompareEntity(EntityExpression x, EntityExpression y)
 {
     return(x.Entity == y.Entity && this.Compare(x.Expression, y.Expression));
 }