mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
change return type from always true (#516)
This commit is contained in:
@@ -1201,8 +1201,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
ChangeDatabaseParams changeDatabaseParams,
|
ChangeDatabaseParams changeDatabaseParams,
|
||||||
RequestContext<bool> requestContext)
|
RequestContext<bool> requestContext)
|
||||||
{
|
{
|
||||||
ChangeConnectionDatabaseContext(changeDatabaseParams.OwnerUri, changeDatabaseParams.NewDatabase);
|
await requestContext.SendResult(ChangeConnectionDatabaseContext(changeDatabaseParams.OwnerUri, changeDatabaseParams.NewDatabase));
|
||||||
await requestContext.SendResult(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1210,7 +1209,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ownerUri">URI of the owner of the connection</param>
|
/// <param name="ownerUri">URI of the owner of the connection</param>
|
||||||
/// <param name="newDatabaseName">Name of the database to change the connection to</param>
|
/// <param name="newDatabaseName">Name of the database to change the connection to</param>
|
||||||
public void ChangeConnectionDatabaseContext(string ownerUri, string newDatabaseName)
|
public bool ChangeConnectionDatabaseContext(string ownerUri, string newDatabaseName)
|
||||||
{
|
{
|
||||||
ConnectionInfo info;
|
ConnectionInfo info;
|
||||||
if (TryFindConnection(ownerUri, out info))
|
if (TryFindConnection(ownerUri, out info))
|
||||||
@@ -1233,6 +1232,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
parameters.Connection = summary.Clone();
|
parameters.Connection = summary.Clone();
|
||||||
parameters.OwnerUri = ownerUri;
|
parameters.OwnerUri = ownerUri;
|
||||||
ServiceHost.SendEvent(ConnectionChangedNotification.Type, parameters);
|
ServiceHost.SendEvent(ConnectionChangedNotification.Type, parameters);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -1246,6 +1246,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user