Beispiel #1
0
        public void CreateListener(ConfigurationLevels level, string documentPath, Func <ConfigurationLevels, string, Task> LoadOnChangeAsyncCallback)
        {
            var document = FirestoreClient.Document(documentPath);

            ConfigurationDocuments.Add(level, document);
            document.Listen(async snapshot => await LoadOnChangeAsyncCallback(level, snapshot.Id));
        }
        public void CreateListeners(Func <ConfigurationLevels, string, Task> loadOnChangeAsyncCallback)
        {
            ConfigurationDocuments.Add(ConfigurationLevels.Application, FirestoreClient.Document(_options.GetApplicationDocumentPath()));
            ConfigurationDocuments.Add(ConfigurationLevels.Stage, FirestoreClient.Document(_options.GetStageDocumentPath()));
            ConfigurationDocuments.Add(ConfigurationLevels.Tag, FirestoreClient.Document(_options.GetTagDocumentPath()));

            ConfigurationDocuments.ToList().ForEach(d =>
                                                    ConfigurationListeners.Add(d.Key, d.Value.Listen(async snapshot =>
            {
                await loadOnChangeAsyncCallback(d.Key, snapshot.Reference.Path);
            }))
                                                    );
        }