Пример #1
0
        private void CorrectConnectionStringsInConfigFiles()
        {
            List <string> configFiles = new List <string>();

            configFiles.AddRange(MyFileWorker.DirectoryGetFiles(solutionFolderName, "app.config"));
            configFiles.AddRange(MyFileWorker.DirectoryGetFiles(solutionFolderName, "web.config"));
            string dbName = GetDBNameFromSlnPath(slnPath);

            foreach (string configFile in configFiles)
            {
                var configXML = MyFileWorker.LoadXDocument(configFile);
                CorrectConnectionString(configXML, dbName);
                MyFileWorker.SaveXDocument(configXML, configFile);
            }
        }