feat(aihitMainSyncer): refactoring

This commit is contained in:
Mikhail Kuznetsov
2025-05-30 09:50:47 +10:00
parent 0fd0b4881f
commit 6c90645073
4 changed files with 237 additions and 231 deletions

View File

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

View File

@@ -4,6 +4,5 @@ namespace PARR.DAL.Services.Interfaces.Unit
{
public interface IUnitService : IBaseService<Models.Unit.Unit>
{
Task<Models.Unit.Unit?> GetUnitByName(string name);
}
}