diff --git a/BLL/BLL.csproj b/BLL/BLL.csproj index b0d3427..61194cb 100644 --- a/BLL/BLL.csproj +++ b/BLL/BLL.csproj @@ -6,10 +6,6 @@ enable - - - - diff --git a/BLL/Integracion_DGA/BusinessLogic.cs b/BLL/Integracion_DGA/BusinessLogic.cs index 63d0871..bfd21f8 100644 --- a/BLL/Integracion_DGA/BusinessLogic.cs +++ b/BLL/Integracion_DGA/BusinessLogic.cs @@ -29,7 +29,6 @@ namespace BLL.Integracion_DGA _jobs = jobs; _jobsVilos = jobsVilos; _jobsSupFluj = jobsSupFluj; - FileLoggerHelper.ConfigureLogger(_configuration); } diff --git a/BLL/Integracion_DGA/ApiService.cs b/DAS/ApiService.cs similarity index 97% rename from BLL/Integracion_DGA/ApiService.cs rename to DAS/ApiService.cs index d666502..55da9ce 100644 --- a/BLL/Integracion_DGA/ApiService.cs +++ b/DAS/ApiService.cs @@ -1,7 +1,4 @@ -using System.Text.Json; -using System.Text; -using Azure.Core; -using System; +using System.Text; using Newtonsoft.Json; namespace BLL.Integracion_DGA diff --git a/DAS/DAS.csproj b/DAS/DAS.csproj index 32cc321..8b0e9bd 100644 --- a/DAS/DAS.csproj +++ b/DAS/DAS.csproj @@ -8,6 +8,7 @@ + diff --git a/Recuperacion_DGA/Program.cs b/Recuperacion_DGA/Program.cs index 3751555..421851f 100644 --- a/Recuperacion_DGA/Program.cs +++ b/Recuperacion_DGA/Program.cs @@ -1,2 +1,39 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +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(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(); + }) + .Build(); + + var envioDGA = host.Services.GetRequiredService(); + var mediciones = await envioDGA.ObtenerMedicionesAsync(); + + Console.WriteLine($"Se obtuvieron {mediciones.Count} registros."); + } + } +} \ No newline at end of file diff --git a/Recuperacion_DGA/Recuperacion_DGA.csproj b/Recuperacion_DGA/Recuperacion_DGA.csproj index 2150e37..0f16dd5 100644 --- a/Recuperacion_DGA/Recuperacion_DGA.csproj +++ b/Recuperacion_DGA/Recuperacion_DGA.csproj @@ -7,4 +7,17 @@ enable + + + + + + + + + + + + +