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.

Basic LINQ query operators

Basic LINQ query operators - LINQ Tutorial

From the course: LINQPad Essential Training

Basic LINQ query operators

- [Instructor] Now that we have a query data source we can use LINQ to perform many operations on the data. The heart of LINQ queries live within the LINQ query operators which are implemented as extension methods. I'm using the same string data source as in the last video. It's hiding here in this region. Here's our first call to an extension method. This is the where extension method. So you see how I'm calling it on the list of strings I call .where, and it expects a predicate function that determines which items belong in the output and which items don't. So my predicate is the string starts with an upper case B and then it will dump out the results here. Now let's talk about deferred execution before I run this query. That's one of the principles of LINQ, is the query. This is setting up the potential query, storing it in this variable. It's not until we iterate over the query itself that we run the query.…

Contents