fix transfer filtration

This commit is contained in:
Zakharov_Rostislav 2024-05-25 22:53:28 +04:00
parent 5a9ee9e6b6
commit 4b24ac5ae9
2 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,6 @@ namespace BankContracts.SearchModels
public int? OperationId { get; set; }
public int? SenderAccountId { get; set; }
public int? RecipientAccountId { get; set; }
public int ManagerId { get; set; }
public int? ManagerId { get; set; }
}
}

View File

@ -33,7 +33,7 @@ namespace BankDatabaseImplement.Implements
.Include(x => x.Operation)
.Where(x =>
(!model.Id.HasValue || x.Id == model.Id) &&
((x.SenderAccount != null && x.SenderAccount.ManagerId == model.ManagerId) ||
(!model.ManagerId.HasValue || (x.SenderAccount != null && x.SenderAccount.ManagerId == model.ManagerId) ||
(x.RecipientAccount != null && x.RecipientAccount.ManagerId == model.ManagerId)) &&
(!model.SenderAccountId.HasValue || x.SenderAccountId == model.SenderAccountId) &&
(!model.RecipientAccountId.HasValue || x.RecipientAccountId == model.RecipientAccountId) &&