コード例 #1
0
        private async Task <ExposureDataServerConfiguration> LoadExposureDataServerConfiguration()
        {
            var serverConfigurationPath = Path.Combine(_configurationDir, Constants.EXPOSURE_DATA_SERVER_CONFIGURATION_FILENAME);

            if (File.Exists(serverConfigurationPath))
            {
                return(JsonConvert.DeserializeObject <ExposureDataServerConfiguration>(
                           await System.IO.File.ReadAllTextAsync(serverConfigurationPath)
                           ));
            }

            var serverConfiguration = new ExposureDataServerConfiguration();
            var json = JsonConvert.SerializeObject(serverConfiguration, Formatting.Indented);
            await File.WriteAllTextAsync(serverConfigurationPath, json);

            return(serverConfiguration);
        }
コード例 #2
0
 public ExposureDataServer(ExposureDataServerConfiguration serverConfiguration)
 {
     _serverConfiguration = serverConfiguration;
     _client = new HttpClient();
 }