Синхронизация данных АИХ ИТ с ПАРР
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.V1;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class HostService : BaseService<V1_Host>, IHostService
|
||||
internal class HostService : BaseService<Host>, IHostService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<HostService> logger;
|
||||
|
||||
protected override DbSet<V1_Host> EntitySet => dataContext.Hosts;
|
||||
protected override DbSet<Host> EntitySet => dataContext.Hosts;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
public HostService(DataContext dataContext, ILogger<HostService> logger) : base(logger)
|
||||
@@ -21,7 +21,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public async Task<V1_Host?> GetHostWithAppsAsync(string IP, string RegionalEK)
|
||||
public async Task<Host?> GetHostWithAppsAsync(string IP)
|
||||
{
|
||||
|
||||
//try
|
||||
@@ -37,21 +37,7 @@ namespace PARR.DAL.Services.Implementations
|
||||
return await EntitySet
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
|
||||
.AsSplitQuery()
|
||||
.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
}
|
||||
|
||||
public async Task<V1_Host?> GetHostWithAppsAsync(string IP, string linkEK, string regionalEK)
|
||||
{
|
||||
return await EntitySet
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
|
||||
.AsSplitQuery()
|
||||
.FirstOrDefaultAsync(h => h.IP == IP && h.LinkEK == linkEK && h.RegionalEK == regionalEK);
|
||||
}
|
||||
|
||||
|
||||
public async Task<V1_Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK)
|
||||
{
|
||||
return await EntitySet.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
.FirstOrDefaultAsync(h => h.IP == IP);
|
||||
}
|
||||
|
||||
//public async Task<Host?> GetHostByRegionalEKAsync(string RegionalEK)И
|
||||
|
||||
Reference in New Issue
Block a user