feat(aihitMainSyncer): refactoring
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,5 @@ namespace PARR.DAL.Services.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitService : IBaseService<Models.Unit.Unit>
|
||||
{
|
||||
Task<Models.Unit.Unit?> GetUnitByName(string name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user