using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using WiDAL.DTOs; using WiDAL.Query.Wi; namespace WiDAL.CustomCode.ScanTarget; public class EmployeeScanTargetDAL : IEmployeeScanTargetDAL { private readonly IQueryExecutor _qe; public EmployeeScanTargetDAL(IQueryExecutor qe) => _qe = qe; public async Task GetByIdAsync(int employeeId, LoginDTO login, CancellationToken ct) { var rows = await _qe.QueryAsync(login, EmployeeScanTargetQB.GET_BY_ID, new { EmployeeId = employeeId, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false); return rows.FirstOrDefault(); } public async Task> SearchAsync(string searchTerm, LoginDTO login, CancellationToken ct) => await _qe.QueryAsync(login, EmployeeScanTargetQB.SEARCH, new { SearchTerm = searchTerm ?? string.Empty, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false); }