feat(aihitMainSyncer): Написана логика создания новых Unit и Field.

This commit is contained in:
Mikhail Kuznetsov
2025-05-19 16:09:55 +10:00
parent 082bc9bf15
commit 1ce8fcb284
18 changed files with 328 additions and 12 deletions

View File

@@ -19,5 +19,10 @@ namespace PARR.DAL.Services.Implementations.Unit
{
this.dataContext = dataContext;
}
public async Task<UnitField?> GetByAihitNameAsync(string name)
{
return await EntitySet.FirstOrDefaultAsync(uf => uf.AihitName.ToLower() == name.ToLower());
}
}
}

View File

@@ -18,5 +18,20 @@ namespace PARR.DAL.Services.Implementations.Unit
{
this.dataContext = dataContext;
}
public async Task<Models.Unit.Unit?> GetUnitWithFieldsAsync(string name)
{
return await GetUnitWithIncludeFields()
.FirstOrDefaultAsync(u => u.Name.ToLower() == name.ToLower());
}
private IQueryable<Models.Unit.Unit> GetUnitWithIncludeFields()
{
return EntitySet
.Include(t => t.UnitFields)
.ThenInclude(f => f.UnitField);
}
}
}