Example #1
0
 protected virtual IEntityGraph GetEntityGraph(Type type)
 {
     return(this.EntityGraphBuilders.GetOrAdd(type, key =>
     {
         var builder = new EntityGraphBuilder(new EntityGraphMapping(this.Table, key));
         return builder.Build(this.Table, this.Mapper);
     }));
 }
Example #2
0
        protected static IEnumerable <IEntityGraphNode> GetChildren(EntityGraphBuilder builder, IEntityGraphNode parent, IEntityMapper mapper)
        {
            var children = new List <IEntityGraphNode>();

            foreach (var relation in parent.Table.Relations)
            {
                if (!mapper.Relations.Contains(relation))
                {
                    continue;
                }
                if (children.Any(child => TableComparer.TableConfig.Equals(child.Relation.RightTable, relation.RightTable)))
                {
                    continue;
                }
                children.Add(builder.CreateNode(parent, relation, mapper));
            }
            return(children);
        }