AzurePoolCrossDbGenerator/CreateMasterKey.cs
/// <summary>
/// Generates *CREATE MASTER KEY* statements 
/// </summary>
/// <param name="configFile"></param>
Generates *CREATE MASTER KEY* statements
Generates * CREATE MASTER KEY * statements
public static void CreateMasterKey(Configs.CreateMasterKey[] config)
        {
            Configs.CreateMasterKey sharedConfig = new Configs.CreateMasterKey();
            string templateContents = Generators.GetTemplateContents("CreateMasterKey.txt");
            for (int i = 0; i < config.Length; i++)
            {
                sharedConfig = (Configs.CreateMasterKey)config[i].Merge(sharedConfig);
                string outputContents = string.Format(templateContents, config[i].localDB, config[i].password, config[i].credential, config[i].identity, config[i].secret);
                string outputFileName = $"CreateMasterKey__{config[i].localDB}__x__x{fileExtSQL}";
                Generators.SaveGeneratedScript(outputContents, outputFileName, i);
            }
        }
public static void CreateMasterKey ( Configs . CreateMasterKey [ ] config ) { Configs . CreateMasterKey sharedConfig = new Configs . CreateMasterKey ( ) ; string templateContents = Generators . GetTemplateContents ( " " ) ; for ( int i = 0 ; i < config . Length ; i ++ ) { sharedConfig = ( Configs . CreateMasterKey ) config [ i ] . Merge ( sharedConfig ) ; string outputContents = string . Format ( templateContents , config [ i ] . localDB , config [ i ] . password , config [ i ] . credential , config [ i ] . identity , config [ i ] . secret ) ; string outputFileName = $" CreateMasterKey__ { config [ i ] . localDB } __x__x { fileExtSQL } " ; Generators . SaveGeneratedScript ( outputContents , outputFileName , i ) ; } }
Generates *CREATE MASTER KEY* statements
Generates * CREATE MASTER KEY * statements
// load data // generate output one file at a time // merge with the previous full version of the config // interpolate
config
Configs.CreateMasterKey[]
configFile
None