private void btreturnTestByCondition_Click(object sender, RoutedEventArgs e) { var found = bl.getTestByPredicate(x => x.passed == Success.passed); string temp = ""; foreach (var item in found) { temp += item; } MessageBox.Show(temp, "Trainee that passed", MessageBoxButton.OK); }