I've got a Student list where I would like to create a query where gets all the items and not 1 by 1 as I show the code below:
IEnumerable<Student> = ...
List<AnsweredTest> ats = new List<AnsweredTest>();
foreach (var s in students)
{
query = from at in Database.Current.AnsweredTests
where at.StudentId == s.StudentId
select at;
ats.Add(query.Single());
}
listView.ItemsSource = ats;
This is not good for the performance. I hope make myself clear, if not please let me know.