using System;
using System.Configuration;

namespace SolviaOneDriveKillerLib.Helpers
{
    public class ConfigurationHelper
    {
        public static T GetConfigValue<T>(string key, T defaultValue)
        {
            string value = ConfigurationManager.AppSettings[key];
            if (value != null)
            {
                return (T)Convert.ChangeType(value, typeof(T));
            }
            return defaultValue;
        }
    }
}
