public async Task <Configuration?> GetConfiguration( string connector, string name, [Service] IConfigurationDatabase configurationDatabase) => (await configurationDatabase.GetConfigurationSource(connector, name)) is null ? null : new Configuration(connector, name);
public async Task <Flow> SetFlow( string name, SourceConfig?source, [Service] IConfigurationDatabase configurationDatabase) { await configurationDatabase.SetFlow(name, source); return(new Flow(name)); }
public async Task <Configuration> SetConfiguration( string connector, string name, SourceConfig?source, [Service] IConfigurationDatabase configurationDatabase) { await configurationDatabase.SetConfiguration(connector, name, source); return(new Configuration(connector, name)); }
public async Task <IEnumerable <Configuration> > GetConnections( [Service] IConfigurationDatabase database) { var configDict = await database.ListConfigurations(); if (!configDict.TryGetValue(Name, out var items)) { return(Enumerable.Empty <Configuration>()); } return(items.Select(o => new Configuration(Name, o))); }
public async Task <Configuration?> GetConnection( string name, [Service] IConfigurationDatabase database) { var configDict = await database.ListConfigurations(); if (!configDict.TryGetValue(Name, out var items) || !items.Contains(name)) { return(null); } return(new Configuration(Name, name)); }
public async Task <SourceConfig?> GetConfig( [Parent] Configuration configuration, [Service] IConfigurationDatabase configurationDatabase) => await configurationDatabase.GetConfigurationSource(configuration.Connector, configuration.Name);
public Task <SourceConfig?> GetConfig( [Parent] Flow flow, [Service] IConfigurationDatabase configurationDatabase) => configurationDatabase.GetFlowSource(flow.Name);
public bool GetIsReadOnly( [Service] IConfigurationDatabase configurationDatabase) => configurationDatabase.IsReadOnly;
public async Task <IEnumerable <Flow> > GetFlows( [Service] IConfigurationDatabase configurationDatabase) => (await configurationDatabase.ListFlows()) .Select(o => new Flow(o));
public async Task <Flow?> GetFlow( string name, [Service] IConfigurationDatabase configurationDatabase) => (await configurationDatabase.GetFlowSource(name)) is null ? null : new Flow(name);
public async Task <IEnumerable <Connection> > GetConnections( [Service] IConfigurationDatabase configurationDatabase) => (await configurationDatabase.ListConfigurations()) .Select(o => new Connection(o.Key, o.Value.Select(value => new Configuration(o.Key, value)).ToList()));
public ConfigurationProviderReceiver(IConfigurationProviderNotifier notifier, IConfigurationDatabase database) { this.notifier = notifier; this.database = database; }