feat(dal): ShortcodesService добавлена обработка динамичесих составляющих "%СВЯЗИ%", "%ТНК-КРАТКО%"

This commit is contained in:
Mikhail Kuznetsov
2025-12-09 16:50:35 +10:00
parent b033f95116
commit d19aa77ec4
18 changed files with 1265 additions and 280 deletions

View File

@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.Unit;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces.Unit;
namespace PARR.DAL.Services.Implementations.Unit
{
internal class UnitInUnitService : IUnitInUnitService
{
private readonly DataContext dataContext;
private readonly ILogger<UnitInUnitService> logger;
public UnitInUnitService(
DataContext dataContext,
ILogger<UnitInUnitService> logger
)
{
this.dataContext = dataContext;
this.logger = logger;
}
public Task<List<UnitInUnit>> GetByParentIdAsync(Guid parentId)
{
return dataContext.UnitInUnits
.Where(u => u.ParentUnitId == parentId)
.ToListAsync();
}
public Task<List<UnitInUnit>> GetByChildIdAsync(Guid childId)
{
return dataContext.UnitInUnits
.Where(u => u.ChildUnitId == childId)
.ToListAsync();
}
}
}