- проверяем доступные в базе значения - проверяем наличие значений в юнитах по id значений
29 lines
916 B
C#
29 lines
916 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Logging;
|
|
using PARR.Core.Repositories.Interfaces.Unit;
|
|
using PARR.DAL.Context;
|
|
using PARR.DAL.Repositories.Base;
|
|
using PARR.Domain.Entities.Unit;
|
|
|
|
namespace PARR.DAL.Repositories.Unit
|
|
{
|
|
internal class UnitFieldValueRepository : BaseRepository<UnitFieldValue>, IUnitFieldValueRepository
|
|
{
|
|
public UnitFieldValueRepository(DataContext dataContext, ILogger<UnitFieldValueRepository> logger) : base(logger, dataContext) { }
|
|
|
|
public async Task<List<Guid>> FindValueIdsByMaskAsync(
|
|
string mask,
|
|
CancellationToken ct = default)
|
|
{
|
|
var query = EntitySet.AsNoTracking();
|
|
|
|
var valueIds = await query
|
|
.Where(v => EF.Functions.ILike(v.Value!, mask))
|
|
.Select(v => v.Id)
|
|
.ToListAsync(ct);
|
|
|
|
return valueIds;
|
|
}
|
|
}
|
|
}
|