From the course: Visual Basic Essential Training

Unlock the full course today

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

Use LINQ with lists

Use LINQ with lists - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Use LINQ with lists

Link is a deep topic, one that deserves a longer look. We have time to explore one small aspect of Link, how to work with the link extension. To do that I'll work with this list of integers. All of these values that I used in the initializer, and what I want to do is use Link to calculate the total, the average and I'll show you how to string together multiple extension methods. So, we'll start with the total. I'll use the equal sign and then the list of integers, then I'll hit the dot operator. And filter down to the extension methods, this is the one we're looking for, sum, here's the details about what this sum of it does. Computes the sum of sequence of integer values. I'll do the same thing for average, and then finally we'll string together multiple extension methods. Look at this one it's called take, returns a specified number of continuous elements from the start of the sequence. So, I want to take the first four…

Contents