Пример #1
0
        private void IterateEntities(EntityTemplate entityTemplate)
        {
            // retrieve metadata for the template
            entityTemplate.Attributes = RetrieveMetadata(entityTemplate);
            var mockarooData    = new MockarooData(entityTemplate);
            var mockarooDataSet = mockarooData.Initialize( );
            var parentIds       = CreateRecords(entityTemplate, entityTemplate.Attributes, mockarooDataSet);

            //Iterate children
            foreach (var childEntity in entityTemplate.ChildrenEntities)
            {
                IterateEntities(childEntity, parentIds, entityTemplate.Name);
            }
        }
Пример #2
0
        // Iterates children
        private void IterateEntities(EntityTemplate entityTemplate,
                                     List <Guid> parentIds,
                                     string parentSchemaName)
        {
            entityTemplate.Attributes = RetrieveMetadata(entityTemplate);

            foreach (var parentId in parentIds)
            {
                var mockarooData    = new MockarooData(entityTemplate);
                var mockarooDataSet = mockarooData.Initialize( );
                var newParentId     = CreateRecords(entityTemplate, entityTemplate.Attributes, mockarooDataSet, parentId, parentSchemaName);

                foreach (var childEntity in entityTemplate.ChildrenEntities)
                {
                    IterateEntities(childEntity, newParentId, entityTemplate.Name);
                }
            }
        }