namespace BLW_Log.Models
{
    public class ReadConfig
    {
        public static ReadConfig Instance = new ReadConfig();
        public IConfiguration Configuration { get; set; }
        public string MySQLConnectionString { get; set; }
        public string ProductionlineSQLConnectionString { get; set; }

        public string MQTTAgentUrl { get; set; }
        public ReadConfig()
        {
            Configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("blwappsettings.json").Build();
            MySQLConnectionString = Configuration.GetConnectionString("MysqlConnStr"); 
            ProductionlineSQLConnectionString = Configuration.GetConnectionString("ProductionlineSQLConString"); 

            MQTTAgentUrl = Configuration.GetSection("MQTT_Agent_Url").Value;
        }
        public string GetCRICS_URL()
        {
            string? str = Configuration.GetSection("CRICSUrl").Value;
            return str;
        }
    }
}
