using BLL.Integracion_DGA; using BLL.Recuperacion_DGA; using DAL; using DAS; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Shared.Utils; namespace Recuperacion_DGA { class Program { static async Task Main(string[] args) { ObtenerVariablesEntorno.AmbientarApiUrlNexus("NEXUS_API_URL"); ObtenerVariablesEntorno.AmbientarUrlApiSubterranea("SUBTERRANEAS_API_URL"); ObtenerVariablesEntorno.AmbientarConexionBd("CONEXION_BD_ENVIO_DGA"); ObtenerVariablesEntorno.AmbientarCredencialesDGA("DGA_CREDENCIALES"); using IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices((context, services) => { IConfiguration configuration = context.Configuration; services.AddSingleton(configuration); services.AddScoped(); services.AddScoped(); services.AddHttpClient(); //Estos dos servicios son los que migre del otro proyecto services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); }) .Build(); //TODO: Controlar si las variables de ambiente existen //TODO: Log de texto var envioDGA = host.Services.GetRequiredService(); await envioDGA.RegistrarMedicionesAsync(); //TODO: Log de texto } } }