private Lazy <IReadOnlyList <ResourceChildItem> > LazyInitializeContainedTypes() { return(new Lazy <IReadOnlyList <ResourceChildItem> >( () => // Collections Collections .Where(c => FilterContext.MemberFilter.ShouldInclude(c.PropertyName)) .Select(c => c.ItemType) .Concat(Collections.SelectMany(c => c.ItemType.ContainedItemTypes)) // EmbeddedObjects .Concat( EmbeddedObjects .Where(o => FilterContext.MemberFilter.ShouldInclude(o.PropertyName)) .Select(o => o.ObjectType)) .Concat(EmbeddedObjects.SelectMany(o => o.ObjectType.ContainedItemTypes)) // Extensions .Concat( Extensions .Where(x => FilterContext.MemberFilter.ShouldIncludeExtension(x.PropertyName)) .Select(x => x.ObjectType)) .Concat(Extensions.SelectMany(x => x.ObjectType.ContainedItemTypes)) .ToList() )); }
private Lazy <IReadOnlyList <Reference> > LazyInitializeContainedReferences() { return(new Lazy <IReadOnlyList <Reference> >( () => References .Concat(Collections.SelectMany(c => c.ItemType.ContainedReferences)) .Concat(EmbeddedObjects.SelectMany(o => o.ObjectType.ContainedReferences)) .Concat(Extensions.SelectMany(o => o.ObjectType.ContainedReferences)) .Distinct(ModelComparers.ReferenceTypeNameOnly) .ToList() )); }