From the course: LINQPad Essential Training

Unlock this course with a free trial

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

Run simple LINQ query expressions

Run simple LINQ query expressions - LINQ Tutorial

From the course: LINQPad Essential Training

Run simple LINQ query expressions

- It's time to look at using LINQPad to work with a LINQ query. After all it was created for this purpose. I'm using the statement editor for this example, as there are multiple lines of code needed to set up and run the query. On line six, we create the data source. In this example, it's a list of T, of type long, on lines 10 through 12 would create the query expression, the potential query against the odd number source. Finally, on line 13, we execute the query and pass the results to Console.Writeline. To execute the query, I'll click on the execute button. Now let's look in the results pane. They are shown in a table. The table has a header that shows the underlying source type, I innumerable event 64, and the header shows that there are seven items in the table. This table is collapsible and expandable. This is remarkable. We're calling Console.Writeline, yet LINQPad is formatting the results in this…

Contents