Applying Changes to SQL Database Projects and Using Projects in Comparison (#1296)

* passing initial testing

* update local project from database

* update local project

* update project from database

* update project from database

* update project from database

* update project from database

* update project from database

* update project from database

* update project from database

* update project from database

* update project from database

* update project from database

* Bump .net version

* PR feedback

* Adding temporary compat shim

* reverting some formatting changes; fixing strings

* PR feedback

Co-authored-by: Noureldine Yehia <t-nyehia@microsoft.com>
This commit is contained in:
Benjin Dubishar
2021-11-12 12:51:35 -08:00
committed by GitHub
parent 1d5db8ac29
commit a74b55c6a8
13 changed files with 1072 additions and 104 deletions

View File

@@ -100,13 +100,17 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
{
SchemaCompareEndpointInfo endpointInfo = new SchemaCompareEndpointInfo();
// if the endpoint is a dacpac we don't need to parse the xml
SchemaCompareDacpacEndpoint dacpacEndpoint = endpoint as SchemaCompareDacpacEndpoint;
if (dacpacEndpoint != null)
// if the endpoint is a dacpac or a project, we don't need to parse the xml
if (endpoint is SchemaCompareDacpacEndpoint dacpacEndpoint)
{
endpointInfo.EndpointType = SchemaCompareEndpointType.Dacpac;
endpointInfo.PackageFilePath = dacpacEndpoint.FilePath;
}
else if (endpoint is SchemaCompareProjectEndpoint projectEndpoint)
{
endpointInfo.EndpointType = SchemaCompareEndpointType.Project;
endpointInfo.ProjectFilePath = projectEndpoint.ProjectFilePath;
}
else
{
// need to parse xml to get connection string of database
@@ -131,7 +135,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
}
catch (Exception e)
{
ErrorMessage = string.Format(SR.OpenScmpConnectionBasedModelParsingError, ((SchemaCompareDatabaseEndpoint)endpoint).DatabaseName,e.Message);
ErrorMessage = string.Format(SR.OpenScmpConnectionBasedModelParsingError, ((SchemaCompareDatabaseEndpoint)endpoint).DatabaseName, e.Message);
Logger.Write(TraceEventType.Error, string.Format("Schema compare open scmp operation failed during xml parsing with exception {0}", e.Message));
throw;
}