Example #1
0
        public static ManifestContent ToData(CdmManifestDefinition instance, ResolveOptions resOpt, CopyOptions options)
        {
            // Checks if incremental trait is needed from foundations.cdm.json
            ImportFoundationsIfIncrementalPartitionTraitExist(instance);

            var documentContent = DocumentPersistence.ToData(instance, resOpt, options);
            var manifestContent = new ManifestContent()
            {
                ManifestName = instance.ManifestName,
                JsonSchemaSemanticVersion = documentContent.JsonSchemaSemanticVersion,
                Schema          = documentContent.Schema,
                Imports         = documentContent.Imports,
                DocumentVersion = documentContent.DocumentVersion
            };

            manifestContent.ManifestName              = instance.ManifestName;
            manifestContent.LastFileStatusCheckTime   = TimeUtils.GetFormattedDateString(instance.LastFileStatusCheckTime);
            manifestContent.LastFileModifiedTime      = TimeUtils.GetFormattedDateString(instance.LastFileModifiedTime);
            manifestContent.LastChildFileModifiedTime = TimeUtils.GetFormattedDateString(instance.LastChildFileModifiedTime);
            manifestContent.Entities       = CopyDataUtils.ListCopyData(resOpt, instance.Entities, options);
            manifestContent.SubManifests   = Utils.ListCopyData <ManifestDeclaration>(resOpt, instance.SubManifests, options);
            manifestContent.Explanation    = instance.Explanation;
            manifestContent.ExhibitsTraits = CopyDataUtils.ListCopyData(resOpt, instance.ExhibitsTraits, options);

            if (instance.Relationships != null && instance.Relationships.Count > 0)
            {
                manifestContent.Relationships = instance.Relationships.Select(relationship => { return(E2ERelationshipPersistence.ToData(relationship, resOpt, options)); }).ToList();
            }

            return(manifestContent);
        }
Example #2
0
        public static ManifestContent ToData(CdmManifestDefinition instance, ResolveOptions resOpt, CopyOptions options)
        {
            var documentContent = DocumentPersistence.ToData(instance, resOpt, options);
            var manifestContent = new ManifestContent()
            {
                ManifestName = instance.ManifestName,
                JsonSchemaSemanticVersion = documentContent.JsonSchemaSemanticVersion,
                Schema  = documentContent.Schema,
                Imports = documentContent.Imports
            };

            manifestContent.ManifestName              = instance.ManifestName;
            manifestContent.LastFileStatusCheckTime   = TimeUtils.GetFormattedDateString(instance.LastFileStatusCheckTime);
            manifestContent.LastFileModifiedTime      = TimeUtils.GetFormattedDateString(instance.LastFileModifiedTime);
            manifestContent.LastChildFileModifiedTime = TimeUtils.GetFormattedDateString(instance.LastChildFileModifiedTime);
            manifestContent.Entities       = Utils.ListCopyData(resOpt, instance.Entities, options);
            manifestContent.SubManifests   = Utils.ListCopyData <ManifestDeclaration>(resOpt, instance.SubManifests, options);
            manifestContent.Explanation    = instance.Explanation;
            manifestContent.ExhibitsTraits = Utils.ListCopyData(resOpt, instance.ExhibitsTraits?.Where(trait => !trait.IsFromProperty)?.ToList(), options);

            if (instance.Relationships != null && instance.Relationships.Count > 0)
            {
                manifestContent.Relationships = instance.Relationships.Select(relationship => { return(E2ERelationshipPersistence.ToData(relationship)); }).ToList();
            }

            return(manifestContent);
        }