Exemple #1
0
        private async Task LoadConfig(SMCollection collection)
        {
            Core.CollectionConfiguration = new CollectionConfigurationService(collection, "Core");

            // CollectionsCfg
            CollectionConfig = await Core.CollectionConfiguration.Load <CollectionCfg>() ?? new CollectionCfg();
        }
Exemple #2
0
        private async Task LoadConfigAsync(SMCollection collection)
        {
            Core.CollectionConfiguration = new CollectionConfigurationService(collection, "Core");

            // CollectionsCfg
            CollectionConfig = await Core.CollectionConfiguration.LoadAsync <CollectionCfg>().ConfigureAwait(false) ?? new CollectionCfg();
        }
Exemple #3
0
        private void LoadConfig(SMCollection collection)
        {
            var knoPath = collection.GetKnoFilePath();

            // StartupCfg

            StartupConfig = Core.Configuration.Load <StartupCfg>().Result ?? new StartupCfg();

            // CollectionsCfg

            _collectionsCfg  = Core.Configuration.Load <CollectionsCfg>().Result ?? new CollectionsCfg();
            CollectionConfig = _collectionsCfg.CollectionsConfig.SafeGet(knoPath);

            if (CollectionConfig == null)
            {
                CollectionConfig = new CollectionCfg();
                _collectionsCfg.CollectionsConfig[knoPath] = CollectionConfig;
            }
        }