using FrameworkDAL.DTO.OutboxMonitor; using FrameworkDAL.Query.OutboxMonitor; using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace FrameworkDAL.CustomCode.OutboxMonitor { public sealed class OutboxMonitorDAL : IOutboxMonitorDAL { private readonly IQueryExecutor _qe; public OutboxMonitorDAL(IQueryExecutor qe) => _qe = qe; public async Task> GetStatusListAsync( int? status, int pageOffset, int pageSize, LoginDTO login, CancellationToken ct = default) => (await _qe.QueryAsync( login, OutboxMonitorQB.GET_STATUS_LIST, new { TenantId = login.ClientId, Status = status, PageOffset = pageOffset, PageSize = pageSize }, cancellationToken: ct).ConfigureAwait(false)).ToList(); public async Task> GetByCorrelationAsync( string correlationKey, LoginDTO login, CancellationToken ct = default) => (await _qe.QueryAsync( login, OutboxMonitorQB.GET_BY_CORRELATION, new { TenantId = login.ClientId, CorrelationKey = correlationKey }, cancellationToken: ct).ConfigureAwait(false)).ToList(); } }