public Borrower GetMostHighestBorrower() { var allLoans = _reportsRepository.GetAll(); Loan maxLoan = allLoans.MaxBy(loan => loan.LoanBalance).FirstOrDefault(); Borrower maxBorrower = new Borrower() { Name = "", Balance = 0 }; if (maxLoan != null) { maxBorrower = _borrowerRepository.GetById(maxLoan.BorrowerId); maxBorrower.Balance = maxLoan.LoanBalance; } return(maxBorrower); }
public Borrower GetById(Guid id) { return(_borrowerRepository.GetById(id)); }