Add DacFx Generate Deploy Script operation (#759)

* Adding DacFx Generate Deploy Script operation
This commit is contained in:
kisantia
2019-01-25 11:34:28 -08:00
committed by GitHub
parent adc13cff82
commit 1917100bfb
9 changed files with 211 additions and 30 deletions

View File

@@ -3,6 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlServer.Dac;
using Microsoft.SqlTools.ServiceLayer.Connection;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
using System;
@@ -27,14 +28,14 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
public SqlTask SqlTask { get; set; }
protected SqlConnection SqlConnection { get; private set; }
protected string ConnectionString { get; private set; }
protected DacServices DacServices { get; private set; }
protected DacFxOperation(SqlConnection sqlConnection)
protected DacFxOperation(ConnectionInfo connInfo)
{
Validate.IsNotNull("sqlConnection", sqlConnection);
this.SqlConnection = sqlConnection;
Validate.IsNotNull("connectionInfo", connInfo);
this.ConnectionString = ConnectionService.BuildConnectionString(connInfo.ConnectionDetails);
this.OperationId = Guid.NewGuid().ToString();
}
@@ -78,7 +79,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
try
{
this.DacServices = new DacServices(this.SqlConnection.ConnectionString);
this.DacServices = new DacServices(this.ConnectionString);
Execute();
}
catch (Exception e)