From the course: .NET Essentials: Working with LINQ

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Run a subset of code

Run a subset of code

- [Tutor] This next feature allows us to run a subsection of the code that's shown in the editor. This is a nice feature, it's useful, but it can also trip you up if you're not aware that it exists. First thing we want to look at is we're choosing C sharp statements, that means I can have more than one line of C sharp code. Right now, if I were to run and execute this code, it's going to run all four of these dump methods, and I get four results, in the results window. If I only want to run a subset, all I have to do is select the subset, say these first four lines of code here, and then run. Now it's only going to run, it's going to declare these variables, fill them with values, enter and run the x.dump. Do that again, so you can see it. This works fine, but here's where I can trip you up and happens to me all the time when I'm demonstrating code in LINQPad. I want to bring your attention to this…

Contents