From the course: Visual Basic Essential Training

Unlock this course with a free trial

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

Use LINQ with lists

Use LINQ with lists

- [Instructor] It's time to use Linq to work with our data. One word about terminology, the innumerable extension methods are usually called query operators. We're looking at some of the aggregate operators in this video. So let's start by looking at line five. This is a list of integers that has some numbers going from low numbers to high numbers. And then I'm using several of the aggregate operators here. This is the sum operator. It computes the sum of the sequence, so it'll total all the items that are in the list of integer. I'm sure you can guess what this does. It creates the average of those numbers. And then here, I'm chaining together two of the query operators. I'm using average, but before I call average, I am using another operator called take, and that allows me to take some of the items from the beginning of the sequence, the start of the sequence. This says take the first four, so it's going to take these four items and then calculate the average. In the second…

Contents