using System;
using Microsoft.Extensions.Configuration;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace LAPS_WATCHER.Configure
{
    class CustomConfiguration
    {
        public static IConfiguration AppSettings { get; }
        static CustomConfiguration()
        {
            try
            {
                var builder = new ConfigurationBuilder()
                    .SetBasePath(Path.Combine(AppContext.BaseDirectory))
                    .AddJsonFile("AppSettings.json", true, true);
                AppSettings = new ConfigurationBuilder()
                        .SetBasePath(Path.Combine(AppContext.BaseDirectory))
                        .AddJsonFile("AppSettings.json")
                        .Build();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + " at " + ex.StackTrace);
            }
        }
    }
}
