IsRejected und ReadRejectedAsync Methoden zu EnvelopeHistoryService hinzugefügt.

This commit is contained in:
Developer 02
2024-06-03 10:15:26 +02:00
parent 047c4d09e8
commit 0818b8d606
4 changed files with 38 additions and 3 deletions

View File

@@ -12,10 +12,10 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
{
}
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null)
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, int? status = null)
{
var query = _dbSet.AsQueryable();
if (envelopeId is not null)
query = query.Where(eh => eh.EnvelopeId == envelopeId);
@@ -25,7 +25,17 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
if (status is not null)
query = query.Where(eh => eh.Status == status);
return await query.CountAsync();
return query;
}
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await By(
envelopeId: envelopeId,
userReference: userReference,
status: status).CountAsync();
public async Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await By(
envelopeId: envelopeId,
userReference: userReference,
status: status).ToListAsync();
}
}