private static int BuildDacpacList(string dacpacPath)
        {
            if (!File.Exists(dacpacPath))
            {
                Console.Out.WriteLine("Error:");
                Console.Out.WriteLine($"Could not open .dacpac file: {dacpacPath}");
                return(1);
            }

            var builder = new DacpacTableListBuilder(dacpacPath);

            var values = builder.GetTableDefinitions();

            var result = new List <TableModel>();

            foreach (var value in values)
            {
                var columns = new List <ColumnModel>();

                if (value.Item4 != null)
                {
                    foreach (var colum in value.Item4)
                    {
                        columns.Add(new ColumnModel(colum, value.Item5.Contains(colum)));
                    }
                }

                result.Add(new TableModel(value.Item3, value.Item2, value.Item1, value.Item6 ? RevEng.Shared.ObjectType.Table : RevEng.Shared.ObjectType.View, columns));
            }

            Console.Out.WriteLine("Result:");
            Console.Out.WriteLine(result.Write());

            return(0);
        }
        public void CanGetTableNames()
        {
            // Arrange
            var builder = new DacpacTableListBuilder(dacpac);

            // Act
            var result = builder.GetTableDefinitions();

            // Assert
            Assert.AreEqual("[dbo].[Album]", result[0].Name);
            Assert.AreEqual(11, result.Count);
        }
Exemple #3
0
        public void CanGetTableNames()
        {
            // Arrange
            var builder = new DacpacTableListBuilder(dacpac);

            // Act
            var result = builder.GetTableNames();

            // Assert
            Assert.AreEqual("dbo.Album", result[0]);
            Assert.AreEqual(11, result.Count);
        }
Exemple #4
0
        private static int BuildDacpacList(string dacpacPath)
        {
            if (!File.Exists(dacpacPath))
            {
                Console.Out.WriteLine("Error:");
                Console.Out.WriteLine($"Could not open .dacpac file: {dacpacPath}");
                return(1);
            }

            var builder = new DacpacTableListBuilder(dacpacPath);

            var value = builder.GetTableDefinitions();

            var result = new List <TableInformationModel>();

            result.AddRange(value.Select(v => new TableInformationModel(v.Item1, v.Item2)).ToList());

            Console.Out.WriteLine("Result:");
            Console.Out.WriteLine(result.Write());

            return(0);
        }
        public List <TableInformationModel> GetDacpacTables(string dacpacPath)
        {
            var builder = new DacpacTableListBuilder(dacpacPath);

            return(builder.GetTableDefinitions());
        }