Atomic Star
Atomic Star

Reputation: 5507

Filter a List of objects during debugging in Visual Studio 2013

I have a List<Student> that contains lets say 500 students. When I enter debug mode on a breakpoint is there a way to filter/search for a student?

I don't want to write code for this check as below:

List<Student> students = data.GetStudents();
//break here and filter for student in debug mode
var myStudent = students.Where(k=>k.StudentNumber=="S12312");

Is it is not possible in Visual Studio 2013 to do this, I think it would be a great feature to add...

Upvotes: 6

Views: 5562

Answers (3)

Avner Shahar-Kashtan
Avner Shahar-Kashtan

Reputation: 14700

You can use a 3rd party debugging tool called OzCode (disclaimer: I work for the company that makes it, though I don't work on the product myself).

It extends the QuickWatch debug window to allow searching within the object, looking for strings and values in all the object's properties. It's not a full lambda, but it lets you run a search several levels deep to find a value:

enter image description here

Upvotes: 2

Related Questions