private async Task FillCollectables() { lstCollectables.Items.Clear(); IEnumerable <ILoanModel> _loans = await loans.GetAll(); IEnumerable <CollectablesModel> _collectables = await cols.GetAll(); var collectables = _loans.Join(_collectables, l => l.LoanId, b => b.Loan.LoanId, (l, b) => new { l.LoanId, b.Borrower.FullName, l.PerRemittance, l.PaymentTerm, b.Loan.Collector, l.TotalBalance }).Distinct(); if (cboCollector.SelectedIndex != -1) { UserModel user = (UserModel)cboCollector.SelectedItem; collectables = collectables.Where(col => col.Collector == user.Name); } if (textBox1.Text.Trim() != "") { try { collectables = collectables.Where(col => col.FullName.ToUpper().Contains(textBox1.Text.ToUpper())); } catch (Exception) { MessageBox.Show("Failed to find the borrower! Please Try Again."); } } lblTotal.Text = CalculateCollectibles(collectables).ToString("c"); FillListView(collectables); }