From the course: LINQPad Essential Training

Unlock this course with a free trial

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

Write your own extensions

Write your own extensions - LINQ Tutorial

From the course: LINQPad Essential Training

Write your own extensions

- [Instructor] LINQPad includes the Dump extension method. We're seeing how it helps simplify outputting information to the results window. I run the query and I'm calling Dump here in line six and the results are output in this HTML table. We can add our own extension methods to LINQPad. This is a good choice when you have helper code that enhances your queries. I have an idea for a useful extension method. I'd like to output the data to a delimited list, so I'm going to create an extension method called MakeDelimitedString. The place you write your code for custom extensions is in My Queries, My Extensions. Now, this is implemented as a C-Sharp program. It uses the same features we've seen earlier in the course, there's a void main method and then you create your own classes here. They only differences in this example is that we're using a predefined class called MyExtensions, that's where LINQPad will look for the…

Contents