Refactor ReadHistoryQuery and optimize repository queries
- Changed `EnvelopeId` in `ReadHistoryQuery` to nullable for improved flexibility in queries. - Introduced `withReceiver` variable in `HistoryController` to enhance query logic for retrieving history records. - Updated `EnvelopeHistoryRepository` to use `AsNoTracking()` for better performance in read-only scenarios.
This commit is contained in:
@@ -13,7 +13,7 @@ public class EnvelopeHistoryRepository : CRUDRepository<EnvelopeHistory, long, E
|
||||
|
||||
private IQueryable<EnvelopeHistory> By(int? envelopeId = null, string? userReference = null, int? status = null, bool withSender = false, bool withReceiver = false)
|
||||
{
|
||||
var query = _dbSet.AsQueryable();
|
||||
var query = _dbSet.AsNoTracking();
|
||||
|
||||
if (envelopeId is not null)
|
||||
query = query.Where(eh => eh.EnvelopeId == envelopeId);
|
||||
|
||||
Reference in New Issue
Block a user