2025-06-25 16:39:45 -04:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using DAL;
|
|
|
|
|
using DAS;
|
|
|
|
|
using BLL.Recuperacion_DGA;
|
|
|
|
|
using BLL.Integracion_DGA;
|
|
|
|
|
|
|
|
|
|
namespace Recuperacion_DGA
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
|
|
|
|
static async Task Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
using IHost host = Host.CreateDefaultBuilder(args)
|
|
|
|
|
.ConfigureServices((context, services) =>
|
|
|
|
|
{
|
|
|
|
|
IConfiguration configuration = context.Configuration;
|
|
|
|
|
services.AddSingleton<IConfiguration>(configuration);
|
|
|
|
|
|
|
|
|
|
services.AddScoped<MedicionScadaRepository>();
|
|
|
|
|
services.AddScoped<EnvioDGA>();
|
|
|
|
|
services.AddHttpClient<RegistrarMedicion>();
|
|
|
|
|
//Estos dos servicios son los que migre del otro proyecto
|
|
|
|
|
services.AddScoped<JobsDgaRepository>();
|
|
|
|
|
services.AddScoped<JobsDgaVilosRepository>();
|
|
|
|
|
services.AddScoped<JobsDgaSupFlujRepository>();
|
|
|
|
|
services.AddScoped<ApiService>();
|
|
|
|
|
services.AddScoped<BusinessLogic>();
|
|
|
|
|
})
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var envioDGA = host.Services.GetRequiredService<EnvioDGA>();
|
|
|
|
|
var mediciones = await envioDGA.ObtenerMedicionesAsync();
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"Se obtuvieron {mediciones.Count} registros.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|