Exemple #1
0
        public ActionResult Update([FromBody] ConfigurationJsonModel configuration)
        {
            _logger.LogInformation("Actualizar configuración {@Configuracion}", configuration);

            _adsConfigurationProvider.Update(configuration.ConfigurationJson);

            return(Ok());
        }
Exemple #2
0
 // Method used to load the content of the json file.
 public static void Load()
 {
     try
     {
         // read the json file and deserialize it
         // save the content of each json value into
         // the ConfigurationJsonModel
         ConfigurationJsonModel = JsonConvert.DeserializeObject <ConfigurationJsonModel>(File.ReadAllText(Path.Combine(Configuration.APPDATA_PATH, Configuration.JSON_NAME)));
     }
     catch (Exception ex)
     {
         // set the ConfigurationJsonModel to null
         // we will create a new one as the old
         // does not exist or is corrupted
         ConfigurationJsonModel = null;
         LoggingUtil.Exception(String.Format("Configuration Load Exception {0}", ex));
     }
 }