Esempio n. 1
0
 public async Task <Configuration?> GetConfiguration(
     string connector,
     string name,
     [Service] IConfigurationDatabase configurationDatabase)
 => (await configurationDatabase.GetConfigurationSource(connector, name)) is null
         ? null
         : new Configuration(connector, name);
Esempio n. 2
0
        public async Task <Flow> SetFlow(
            string name,
            SourceConfig?source,
            [Service] IConfigurationDatabase configurationDatabase)
        {
            await configurationDatabase.SetFlow(name, source);

            return(new Flow(name));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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)));
        }
Esempio n. 5
0
        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);
Esempio n. 7
0
 public Task <SourceConfig?> GetConfig(
     [Parent] Flow flow,
     [Service] IConfigurationDatabase configurationDatabase)
 => configurationDatabase.GetFlowSource(flow.Name);
Esempio n. 8
0
 public bool GetIsReadOnly(
     [Service] IConfigurationDatabase configurationDatabase)
 => configurationDatabase.IsReadOnly;
Esempio n. 9
0
 public async Task <IEnumerable <Flow> > GetFlows(
     [Service] IConfigurationDatabase configurationDatabase)
 => (await configurationDatabase.ListFlows())
 .Select(o => new Flow(o));
Esempio n. 10
0
 public async Task <Flow?> GetFlow(
     string name,
     [Service] IConfigurationDatabase configurationDatabase)
 => (await configurationDatabase.GetFlowSource(name)) is null
         ? null
         : new Flow(name);
Esempio n. 11
0
 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;
 }