<commit_before>﻿using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;

namespace RockLib.Configuration.Example.Core
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Configuration Manager Example Harness");

            try
            {
                var applicationId = ConfigurationManager.AppSettings["ApplicationId"];
                string defaultConnectionString = ConfigurationManager.ConfigurationRoot.GetConnectionString("Default");
                var foo = ConfigurationManager.ConfigurationRoot.GetSection("Foo").Get<FooSection>();
                var foo2 = ConfigurationManager.ConfigurationRoot.GetSection("Foo").Get<FooSection>();

                Console.WriteLine($"applicationId: {applicationId}");
                Console.WriteLine($"defaultConnectionString: {defaultConnectionString}");
                Console.WriteLine($"foo: {JsonConvert.SerializeObject(foo)}");
                Console.WriteLine($"foo is same instance as foo2: {ReferenceEquals(foo, foo2)}");

                var notFound = ConfigurationManager.AppSettings["notFound"];
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.ReadLine();

        }

        class FooSection
        {<commit_msg>fixed core example code<commit_after>﻿using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;

namespace RockLib.Configuration.Example.Core
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Configuration Manager Example Harness");

            try
            {
                var applicationId = Config.AppSettings["ApplicationId"];
                string defaultConnectionString = Config.Root.GetConnectionString("Default");
                var foo = Config.Root.GetSection("Foo").Get<FooSection>();
                var foo2 = Config.Root.GetSection("Foo").Get<FooSection>();

                Console.WriteLine($"applicationId: {applicationId}");
                Console.WriteLine($"defaultConnectionString: {defaultConnectionString}");
                Console.WriteLine($"foo: {JsonConvert.SerializeObject(foo)}");
                Console.WriteLine($"foo is same instance as foo2: {ReferenceEquals(foo, foo2)}");

                var notFound = Config.AppSettings["notFound"];
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.ReadLine();

        }

        class FooSection
        {
{'fraction_non_alphanumeric': 0.10449481367652709, 'fraction_numerical': 0.002305032654629274, 'mean_word_length': 2.214814814814815, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5891013', 'n_tokens_mistral': 614, 'n_tokens_neox': 573, 'n_words': 113}