Example #1
0
        private void LoadConfiguration()
        {
            var configFiles = configFileLocator.FindConfigFiles();

            foreach (var configFile in configFiles)
            {
                var metadata = configFileReader.Parse(configFile);
                metadatas[metadata.ConfigName] = metadata;
            }
        }
        private void LoadConfiguration()
        {
            var configFiles = configFileLocator.FindConfigFiles();

            AssertFilesFound();

            foreach (var configFile in configFiles)
            {
                var metadata = configFileReader.Parse(configFile);
                metadatas[metadata.ConfigName] = metadata;
            }

            void AssertFilesFound()
            {
                if (!configFiles.Any())
                {
                    throw new Exception($"No config files found in [{searchPath}]!");
                }
            }
        }