Referenztyp hinzugefügt, um zu klassifizieren, für wen Geschichte geschrieben wird.
This commit is contained in:
@@ -12,7 +12,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
{
|
||||
}
|
||||
|
||||
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, int? status = null, bool withReceiver = false)
|
||||
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
||||
{
|
||||
var query = _dbSet.AsQueryable();
|
||||
|
||||
@@ -25,7 +25,10 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
if (status is not null)
|
||||
query = query.Where(eh => eh.Status == status);
|
||||
|
||||
if(withReceiver)
|
||||
if (withSender)
|
||||
query = query.Include(eh => eh.Sender);
|
||||
|
||||
if (withReceiver)
|
||||
query = query.Include(eh => eh.Receiver);
|
||||
|
||||
return query;
|
||||
@@ -36,10 +39,12 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
|
||||
userReference: userReference,
|
||||
status: status).CountAsync();
|
||||
|
||||
public async Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, int? status = null, bool withReceiver = true) => await By(
|
||||
public async Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
||||
=> await By(
|
||||
envelopeId: envelopeId,
|
||||
userReference: userReference,
|
||||
status: status,
|
||||
withSender: withSender,
|
||||
withReceiver: withReceiver).ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user