Exemplo n.º 1
0
        internal static void ExtractDacpacFile(
            ICakeContext context,
            string connectionString,
            string targetDatabaseName,
            ExtractDacpacSettings settings)
        {
            Initializer.InitializeNativeSearchPath();
            context.Log.Information($"About to extract a dacpac file from database {targetDatabaseName}");

            var service = new DacServices(connectionString);

            service.Extract(settings.OutputFile.FullPath, targetDatabaseName, settings.Name, settings.Version, settings.Description, settings.Tables);

            context.Log.Information($"Finished creating dacpac file from database {targetDatabaseName}. File location is {settings.OutputFile}");
        }
Exemplo n.º 2
0
        public static void ExtractDacpacFile(this ICakeContext context, String connectionString, String targetDatabaseName, ExtractDacpacSettings settings)
        {
            Guard.ArgumentIsNotNull(context, nameof(context));
            Guard.ArgumentIsNotNull(connectionString, nameof(connectionString));
            Guard.ArgumentIsNotNull(targetDatabaseName, nameof(targetDatabaseName));
            Guard.ArgumentIsNotNull(settings, nameof(settings));

            SqlDacpacImpl.ExtractDacpacFile(context, connectionString, targetDatabaseName, settings);
        }