diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs index 43830e50..1904033d 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs @@ -1201,8 +1201,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection ChangeDatabaseParams changeDatabaseParams, RequestContext requestContext) { - ChangeConnectionDatabaseContext(changeDatabaseParams.OwnerUri, changeDatabaseParams.NewDatabase); - await requestContext.SendResult(true); + await requestContext.SendResult(ChangeConnectionDatabaseContext(changeDatabaseParams.OwnerUri, changeDatabaseParams.NewDatabase)); } /// @@ -1210,7 +1209,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection /// /// URI of the owner of the connection /// Name of the database to change the connection to - public void ChangeConnectionDatabaseContext(string ownerUri, string newDatabaseName) + public bool ChangeConnectionDatabaseContext(string ownerUri, string newDatabaseName) { ConnectionInfo info; if (TryFindConnection(ownerUri, out info)) @@ -1233,6 +1232,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection parameters.Connection = summary.Clone(); parameters.OwnerUri = ownerUri; ServiceHost.SendEvent(ConnectionChangedNotification.Type, parameters); + return true; } catch (Exception e) { @@ -1246,6 +1246,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection ); } } + return false; } ///