Ejemplo n.º 1
0
        public async Task RunAsync(FileOptions options)
        {
            logger.LogInformation("Executing {sqlFile} ...", Path.GetFullPath(options.InputSqlFile));
            sqlCommandAdapter.ExecuteSqlCommand();

            logger.LogDebug("Reading SQL schema ...");
            RelationalModel model = relationalModelReader.ReadRelationalModel();

            if (!model.Tables.Any())
            {
                logger.LogWarning("No tables were found ...");
                return;
            }

            logger.LogDebug("Running Annotation Combiner ...");
            annotationCombiner.ReadAnnotationsAndCombineWithModel(model);

            logger.LogDebug("Generating CDM folder ...");
            CdmManifestDefinition manifest = await cdmGenerator.GenerateCdmAsync(model);

            logger.LogInformation("Saving CDM folder at {cdmOutput}...", Path.GetFullPath(options.OutputCdmFolder));
            await manifest.SaveAsync();

            logger.LogInformation("Success!");
        }
Ejemplo n.º 2
0
        public async Task CdmManifestDefinitionIsNotNull()
        {
            CdmGenerator generator = CreateCdmGenerator();
            var          model     = new RelationalModel();

            CdmManifestDefinition manifest = await generator.GenerateCdmAsync(model);

            Assert.NotNull(manifest);
        }
Ejemplo n.º 3
0
        public async Task CdmManifestDefinitionWithEmptyTablesContainsEmptyEntitiesAndRelationships()
        {
            CdmGenerator generator = CreateCdmGenerator();
            var          model     = new RelationalModel();

            CdmManifestDefinition manifest = await generator.GenerateCdmAsync(model);

            Assert.Empty(manifest.Entities);
            Assert.Empty(manifest.Relationships);
        }