feat(dal): ShortcodesService добавлена обработка динамичесих составляющих "%СВЯЗИ%", "%ТНК-КРАТКО%"
This commit is contained in:
37
PARR.DAL/Services/Implementations/Unit/UnitInValueService.cs
Normal file
37
PARR.DAL/Services/Implementations/Unit/UnitInValueService.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.Unit;
|
||||
using PARR.DAL.Services.Interfaces.Unit;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.Unit
|
||||
{
|
||||
internal class UnitInValueService : IUnitInValueService
|
||||
{
|
||||
private readonly ILogger<UnitInValueService> logger;
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
public UnitInValueService(
|
||||
ILogger<UnitInValueService> logger,
|
||||
DataContext dataContext
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
|
||||
public async Task<List<UnitInValue>> GetByUnitIdAsync(Guid unitId)
|
||||
{
|
||||
return await dataContext.UnitInValues
|
||||
.Where(uv => uv.UnitId == unitId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<UnitInValue>> GetByUnitIdsAsync(IEnumerable<Guid> unitIds)
|
||||
{
|
||||
return await dataContext.UnitInValues
|
||||
.Where(uv => unitIds.Contains(uv.UnitId))
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user