refactor: improve sorting logic in Fine, Loan, and Reward repositories

This commit is contained in:
2025-10-25 17:25:08 +03:30
parent 25c7b67eb5
commit 4c6de6a76f
3 changed files with 5 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ public class LoanRepository : RepositoryBase<long, Loan>, ILoanRepository
query = query.Where(x => x.StartInstallmentPayment >= startDate && x.StartInstallmentPayment <= endDate);
}
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
var list = query.ToList().Select(x => new LoanViewModel()
var list = query.OrderByDescending(x=>x.StartInstallmentPayment).ToList().Select(x => new LoanViewModel()
{
Amount = x.Amount.ToMoney(),
AmountDouble = x.Amount,