Ejemplo n.º 1
0
        private void AddRelationElements(List <StructureEntity> allChannelStructureEntities)
        {
            foreach (StructureEntity structureEntity in allChannelStructureEntities.Where(x => x.EntityId != _config.ChannelId && x.Type != "Resource"))
            {
                Entity entity = _entityService.GetEntity(structureEntity.EntityId, LoadLevel.DataOnly);

                LinkType linkType = _config.LinkTypes.FirstOrDefault(x => x.Id == structureEntity.LinkTypeIdFromParent);

                if (linkType == null)
                {
                    continue;
                }

                if (linkType.SourceEntityTypeIsChannelNode())
                {
                    AddChannelNodeRelation(linkType, structureEntity, entity);
                }

                AddRelations(linkType, structureEntity, entity);
            }
        }