private void SetupTelemetryDataSinkMetadataRegistry(ISettingOperations settingOperations) { var telemetryDataSinkSetupServiceClient = _serviceProvider.GetService <ITelemetryDataSinkSetupServiceClient>(); telemetryDataSinkSetupServiceClient.Setup(settingOperations.Get(Setting.TelemetrySetupServiceEndpoint).Value, settingOperations.Get(Setting.TelemetrySetupServiceApiKey).Value); var telemetryDataSinkMetadataRegistry = (TelemetryDataSinkMetadataRegistry)_serviceProvider.GetService <ITelemetryDataSinkMetadataRegistry>(); var telemetryDataSinksMetadata = telemetryDataSinkSetupServiceClient.GetTelemetryDataSinksMetadata(); var telemeryDataSection = new TelemetryDataSection { Incoming = telemetryDataSinksMetadata.Incoming.Select(inc => new TelemetryDataSinkElement { Name = inc.Name, Type = inc.TypeName, Description = inc.Description, ParameterPresets = inc.ParametersPresets?.Select(pp => new TelemetrySinkParameter { Key = pp.Key, Value = pp.Value }).ToArray() }).ToArray() }; telemetryDataSinkMetadataRegistry.Build(telemeryDataSection); }
private static void SafeEnsureSetting(ISettingOperations settingOperations, SettingId name, string value) { try { settingOperations.Get(name); } catch { settingOperations.Create(new Setting(name, value)); } }
private string ReadThrough(SettingId key) { return(_settings.GetOrAdd(key.ToString(), (k) => _settingOperations.Get(key).Value)); }
public ConnectionStringSettings Resolve(string connectionName) { var setting = _connectionStringSettingsList.GetOrAdd(connectionName, connName => _settingOperations.Get(SettingId.GetConnection(connName))); return(new ConnectionStringSettings(connectionName, setting.Value)); }