Separacion de logica integracion y envio DGA
This commit is contained in:
parent
6f64273cdd
commit
fd46c75b42
6 changed files with 54 additions and 11 deletions
|
@ -6,10 +6,6 @@
|
|||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DAL\DAL.csproj" />
|
||||
<ProjectReference Include="..\DAS\DAS.csproj" />
|
||||
|
|
|
@ -29,7 +29,6 @@ namespace BLL.Integracion_DGA
|
|||
_jobs = jobs;
|
||||
_jobsVilos = jobsVilos;
|
||||
_jobsSupFluj = jobsSupFluj;
|
||||
|
||||
FileLoggerHelper.ConfigureLogger(_configuration);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -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<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.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,4 +7,17 @@
|
|||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BLL\BLL.csproj" />
|
||||
<ProjectReference Include="..\SHARED\Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Loading…
Add table
Reference in a new issue