private void lbBooks_SelectedIndexChanged(object sender, EventArgs e) { lbAvailableCopies.Items.Clear(); lbCopies.Items.Clear(); Book selectedBook = lbBooks.SelectedItem as Book; IEnumerable <Loan> allLoans = loanService.AllBookCopiesOnLoan(); IEnumerable <BookCopy> bookCopies = bookCopyService.AllExceptWithBook(allLoans, selectedBook); ShowAllAvailableCopies(bookCopies); ShowAllBookCopiesForBook(bookCopyService.AllCopiesForBook(selectedBook)); }