2025-05-14 15:13:30 +10:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
2026-04-30 10:35:31 +10:00
|
|
|
|
using PARR.Core.Repositories.Interfaces.Unit;
|
2025-05-14 15:13:30 +10:00
|
|
|
|
using PARR.DAL.Context;
|
2026-04-14 09:56:31 +10:00
|
|
|
|
using PARR.DAL.Repositories.Base;
|
2026-04-30 10:35:31 +10:00
|
|
|
|
using PARR.Domain.Entities.Unit;
|
2025-05-14 15:13:30 +10:00
|
|
|
|
|
2026-04-30 10:35:31 +10:00
|
|
|
|
namespace PARR.DAL.Repositories.Unit
|
2025-05-14 15:13:30 +10:00
|
|
|
|
{
|
2026-04-30 10:35:31 +10:00
|
|
|
|
internal class UnitFieldValueRepository : BaseRepository<UnitFieldValue>, IUnitFieldValueRepository
|
2025-05-14 15:13:30 +10:00
|
|
|
|
{
|
2026-04-30 10:35:31 +10:00
|
|
|
|
public UnitFieldValueRepository(DataContext dataContext, ILogger<UnitFieldValueRepository> logger) : base(logger, dataContext) { }
|
2025-05-21 11:53:07 +10:00
|
|
|
|
|
2026-07-28 16:34:04 +10:00
|
|
|
|
public async Task<List<Guid>> FindValueIdsByMaskAsync(
|
|
|
|
|
|
string mask,
|
|
|
|
|
|
CancellationToken ct = default)
|
2025-05-21 11:53:07 +10:00
|
|
|
|
{
|
2026-07-28 16:34:04 +10:00
|
|
|
|
var query = EntitySet.AsNoTracking();
|
2025-05-21 11:53:07 +10:00
|
|
|
|
|
2026-07-28 16:34:04 +10:00
|
|
|
|
var valueIds = await query
|
|
|
|
|
|
.Where(v => EF.Functions.ILike(v.Value!, mask))
|
|
|
|
|
|
.Select(v => v.Id)
|
|
|
|
|
|
.ToListAsync(ct);
|
2025-05-21 11:53:07 +10:00
|
|
|
|
|
2026-07-28 16:34:04 +10:00
|
|
|
|
return valueIds;
|
2025-05-21 11:53:07 +10:00
|
|
|
|
}
|
2025-05-14 15:13:30 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|