From ed5b68bcf98225c6412d538aad35c259d527032d Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Tue, 24 Oct 2017 12:35:00 -0700 Subject: [PATCH] change return type from always true (#516) --- .../Connection/ConnectionService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } ///