Exemplo n.º 1
0
        public static ConfigUpdater GetConfigUpdater(string path, ILogger <ConfigUpdater> logger)
        {
            XDocument     doc           = XDocument.Load(path);
            ConfigUpdater configUpdater = new ConfigUpdater(doc, logger);

            return(configUpdater);
        }
Exemplo n.º 2
0
        public static Dictionary <string, object> GetContext(ConfigUpdater configUpdater)
        {
            Dictionary <string, Uri>    uri     = configUpdater !.GetSchemeToAddressMapping();
            Dictionary <string, object> context = new Dictionary <string, object>
            {
                { "uri", uri },
                { "metadata", configUpdater.SupportsMetadataBehavior() },
                { "debug", configUpdater.SupportsServiceDebug() },
                { "bindings", configUpdater.GetBindings() }
            };

            return(context);
        }
Exemplo n.º 3
0
        public static List <XDocument> ConfigUpdate(ConfigUpdater updater, ILogger logger)
        {
            logger.LogDebug("Start updating configuration files...");
            XDocument wcfConfig = updater.GenerateNewConfig();
            XDocument appConfig = updater.UpdateOldConfig();
            var       result    = new List <XDocument>
            {
                appConfig,
                wcfConfig
            };

            logger.LogInformation("Finish updating configuration files.");
            return(result);
        }