mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-05 09:35:40 -05:00
Getting include objects types names from the DacFx to avoid the duplication and hardcoded values in the ADS
This commit is contained in:
@@ -274,6 +274,8 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
|
||||
private Dictionary<string, string> _displayNameMapDict;
|
||||
|
||||
public Dictionary<string, int> IncludeObjectsTable;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -406,6 +408,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
// Setting Display names for all dacDeploy options
|
||||
SetDisplayNameForOption();
|
||||
|
||||
// Preparing Include Object types options table
|
||||
CreateIncludeObjectsTable();
|
||||
|
||||
// Adding these defaults to ensure behavior similarity with other tools. Dacfx and SSMS import/export wizards use these defaults.
|
||||
// Tracking the full fix : https://github.com/microsoft/azuredatastudio/issues/5599
|
||||
options.AllowDropBlockingAssemblies = true;
|
||||
@@ -436,9 +441,22 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
// Setting Display names for all dacDeploy options
|
||||
SetDisplayNameForOption();
|
||||
|
||||
// Preparing Include Object types options table
|
||||
CreateIncludeObjectsTable();
|
||||
|
||||
SetOptions(options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets include objects enum values and number in to the dictionary
|
||||
/// </summary>
|
||||
public void CreateIncludeObjectsTable()
|
||||
{
|
||||
// Set include objects table data
|
||||
var objectTypeEnum = typeof(ObjectType);
|
||||
IncludeObjectsTable = Enum.GetNames(objectTypeEnum).ToDictionary(t => t, t => (int)System.Enum.Parse(objectTypeEnum, t));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// initialize deployment options from the options in a publish profile.xml
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user