fix(dal): Добавлен Trim для UnitService.GetByName для исключения ошибок длиблкатов ключа
This commit is contained in:
@@ -20,10 +20,10 @@ namespace PARR.DAL.Services.Implementations.Unit
|
||||
}
|
||||
|
||||
|
||||
public async Task<Models.Unit.Unit?> GetUnitByName(string name)
|
||||
public async Task<Models.Unit.Unit?> GetByName(string name)
|
||||
{
|
||||
return await GetUnitWithFieldsAndValues()
|
||||
.FirstOrDefaultAsync(u => u.Name.ToLower() == name.ToLower());
|
||||
.FirstOrDefaultAsync(u => u.Name.ToLower().Trim() == name.ToLower().Trim());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ namespace PARR.DAL.Services.Interfaces.Unit
|
||||
{
|
||||
public interface IUnitService : IBaseService<Models.Unit.Unit>
|
||||
{
|
||||
Task<Models.Unit.Unit?> GetUnitByName(string name);
|
||||
Task<Models.Unit.Unit?> GetByName(string name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user