From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Work with extension methods

Work with extension methods - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Work with extension methods

- To work with LINQ, you'll need to understand extension methods. This is not a topic we've investigated yet, but they are a crucial part of dot net, that was created specifically to build the language integrated query tools. Today we'll look at the enumerable clash shown on line 16. It contains two kinds of methods, normal methods and extension methods. Here I'm looking at the range function. It's generates a list of integers. So I'm providing the starting value and how many integers I want. So I'll get numbers from range 20 to 320. This is a simple example of a normal function. The more interesting part is that the enumerable class is filled with extension methods that help break queries against the data stored in our list instances. Look at that, in this method here. In this example, I've created two generic lists. A list of string and a list of double. Read in the comments that in Enumerable, the extension methods…

Contents