From the course: .NET Essentials: Working with LINQ

Unlock this course with a free trial

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

Show formatted output with the Dump method

Show formatted output with the Dump method - .NET Tutorial

From the course: .NET Essentials: Working with LINQ

Show formatted output with the Dump method

- [Instructor] To make it easier to see the information in the results pane, the LINQPad team has created this helper method called Dump. This is an extension method and you can call this on any variable and it will take the value of the variable, format in a way that makes sense for LINQPad, and then push that out to the results pane. Let's see what that looks like. So the code is simple. I have an integer variable, a string variable, and a Boolean variable. The int variable is set to 65. The Boolean is checking whether X is greater than 1000. And if X is greater than 1000, then I create this result string with the words large number, otherwise it has small number. I want to output all three of these variables to the results pane. In a previous video I used Console.WriteLine, here we'll use Dump. So I'm using that on line 10, that'll output the variable X, like this. So far, it's not any better than…

Contents