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
|
@ -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
Add a link
Reference in a new issue