mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-09 09:42:35 -05:00
Adding sr.strings file and removing hard-coded strings (#52)
* Strings sweep for connection service * String sweep for credentials service * String sweep for hosting * String sweep for query execution service * String sweep for Workspace service * Renaming utility namespace to match standards Renaming Microsoft.SqlTools.EditorServices.Utility to Microsoft.SqlTools.ServiceLayer.Utility to match the naming changes done a while back. Also renaming them on the files that use them * Namespace change on reliable connection * Adding the new resx and designer files * Final bug fixes for srgen Fixing flakey moq package name * Removing todo as per @kevcunnane * Adding using statements as per @llali's comment * Fixing issues from broken unit tests Note: This feature contains changes that will break the contract for saving as CSV and JSON. On success, null is returned as a message instead of "Success". Changes will be made to the vscode component to handle this change.
This commit is contained in:
@@ -18,37 +18,30 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
|
||||
errorMessage = string.Empty;
|
||||
if (string.IsNullOrEmpty(parameters.OwnerUri))
|
||||
{
|
||||
errorMessage = "Error: OwnerUri cannot be null or empty.";
|
||||
errorMessage = SR.ConnectionParamsValidateNullOwnerUri;
|
||||
}
|
||||
else if (parameters.Connection == null)
|
||||
{
|
||||
errorMessage = "Error: Connection details object cannot be null.";
|
||||
errorMessage = SR.ConnectionParamsValidateNullConnection;
|
||||
}
|
||||
else if (string.IsNullOrEmpty(parameters.Connection.ServerName))
|
||||
{
|
||||
errorMessage = "Error: ServerName cannot be null or empty.";
|
||||
errorMessage = SR.ConnectionParamsValidateNullServerName;
|
||||
}
|
||||
else if (string.IsNullOrEmpty(parameters.Connection.AuthenticationType) || parameters.Connection.AuthenticationType == "SqlLogin")
|
||||
{
|
||||
// For SqlLogin, username/password cannot be empty
|
||||
if (string.IsNullOrEmpty(parameters.Connection.UserName))
|
||||
{
|
||||
errorMessage = "Error: UserName cannot be null or empty when using SqlLogin authentication.";
|
||||
errorMessage = SR.ConnectionParamsValidateNullSqlAuth("UserName");
|
||||
}
|
||||
else if( string.IsNullOrEmpty(parameters.Connection.Password))
|
||||
{
|
||||
errorMessage = "Error: Password cannot be null or empty when using SqlLogin authentication.";
|
||||
errorMessage = SR.ConnectionParamsValidateNullSqlAuth("Password");
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(errorMessage))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return string.IsNullOrEmpty(errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user