Remove Value in AddSqlCmdVariableParams (#1885)

This commit is contained in:
Kim Santiago
2023-03-01 10:03:38 -08:00
committed by GitHub
parent 68ac1e01fc
commit c7e64e2334
3 changed files with 4 additions and 13 deletions

View File

@@ -24,11 +24,6 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlProjects.Contracts
/// Default value of the SQLCMD variable
/// </summary>
public string DefaultValue { get; set; }
/// <summary>
/// Value of the SQLCMD variable, with or without the $()
/// </summary>
public string Value { get; set; }
}
/// <summary>

View File

@@ -458,7 +458,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlProjects
internal async Task HandleAddSqlCmdVariableRequest(AddSqlCmdVariableParams requestParams, RequestContext<ResultStatus> requestContext)
{
await RunWithErrorHandling(() => GetProject(requestParams.ProjectUri!).SqlCmdVariables.Add(new SqlCmdVariable(requestParams.Name, requestParams.DefaultValue, requestParams.Value)), requestContext);
await RunWithErrorHandling(() => GetProject(requestParams.ProjectUri!).SqlCmdVariables.Add(new SqlCmdVariable(requestParams.Name, requestParams.DefaultValue)), requestContext);
}
internal async Task HandleDeleteSqlCmdVariableRequest(DeleteSqlCmdVariableParams requestParams, RequestContext<ResultStatus> requestContext)
@@ -472,7 +472,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlProjects
{
SqlProject project = GetProject(requestParams.ProjectUri!);
project.SqlCmdVariables.Delete(requestParams.Name); // idempotent (won't throw if doesn't exist)
project.SqlCmdVariables.Add(new SqlCmdVariable(requestParams.Name, requestParams.DefaultValue, requestParams.Value));
project.SqlCmdVariables.Add(new SqlCmdVariable(requestParams.Name, requestParams.DefaultValue));
}, requestContext);
}