feat(aihitMainSyncer): реализована логика синхронизации таблиц unit.* с данными из АИХ ИТ
This commit is contained in:
@@ -20,18 +20,20 @@ namespace PARR.DAL.Services.Implementations.Unit
|
||||
}
|
||||
|
||||
|
||||
public async Task<Models.Unit.Unit?> GetUnitWithFieldsAsync(string name)
|
||||
public async Task<Models.Unit.Unit?> GetUnitByName(string name)
|
||||
{
|
||||
return await GetUnitWithIncludeFields()
|
||||
return await GetUnitWithFieldsAndValues()
|
||||
.FirstOrDefaultAsync(u => u.Name.ToLower() == name.ToLower());
|
||||
}
|
||||
|
||||
|
||||
private IQueryable<Models.Unit.Unit> GetUnitWithIncludeFields()
|
||||
private IQueryable<Models.Unit.Unit> GetUnitWithFieldsAndValues()
|
||||
{
|
||||
return EntitySet
|
||||
.Include(t => t.UnitFields)
|
||||
.ThenInclude(f => f.UnitField);
|
||||
.Include(u => u.UnitFields)
|
||||
.ThenInclude(f => f.UnitField)
|
||||
.Include(u => u.UnitValues)
|
||||
.ThenInclude(v => v.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user