Вроде все ошибки устранил. не запускал.
This commit is contained in:
@@ -21,21 +21,38 @@ namespace PARR.DAL.Services.Implementations
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public async Task<Host?> GetHostWithAppsAsync(string IP, string RegionalEK)//TODO
|
||||
public async Task<Host?> GetHostWithAppsAsync(string IP, string RegionalEK)
|
||||
{
|
||||
try
|
||||
{
|
||||
var host = await EntitySet.FirstAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
return host;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.LogInformation($"Не найден узел с IP адресом {IP} и региональным ЭК {RegionalEK}");
|
||||
return null;
|
||||
}
|
||||
|
||||
//try
|
||||
//{
|
||||
// var host = await EntitySet.FirstAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
// return host;
|
||||
//}
|
||||
//catch
|
||||
//{
|
||||
// logger.LogInformation($"Не найден узел с IP адресом {IP} и региональным ЭК {RegionalEK}");
|
||||
// return null;
|
||||
//}
|
||||
return await EntitySet
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
|
||||
.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
}
|
||||
|
||||
//public async Task<Host?> GetHostByRegionalEKAsync(string RegionalEK)
|
||||
public async Task<Host?> GetHostWithAppsAsync(string IP, string linkEK, string regionalEK)
|
||||
{
|
||||
return await EntitySet
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(a => a.Application).ThenInclude(t => t.ApplicationType)
|
||||
.FirstOrDefaultAsync(h => h.IP == IP && h.LinkEK == linkEK && h.RegionalEK == regionalEK);
|
||||
}
|
||||
|
||||
|
||||
public async Task<Host?> GetHostByIPAndRegionalEKAsync(string IP, string RegionalEK)
|
||||
{
|
||||
return await EntitySet.FirstOrDefaultAsync(h => h.IP == IP && h.RegionalEK == RegionalEK);
|
||||
}
|
||||
|
||||
//public async Task<Host?> GetHostByRegionalEKAsync(string RegionalEK)И
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
|
||||
Reference in New Issue
Block a user