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 - 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
-
-
-
-
-
-
(Locked)
What sources are valid for LINQ to Objects1m 21s
-
(Locked)
Basic LINQ query operators2m 3s
-
(Locked)
Write LINQ query expressions1m 49s
-
(Locked)
Connect to a database2m 9s
-
(Locked)
Query the database with SQL1m 37s
-
Use the DataContext1m 47s
-
(Locked)
Query the database with a LINQ expression2m 34s
-
(Locked)
Configure an XML file as a data source2m 35s
-
(Locked)
Query the XML file1m 8s
-
(Locked)
Filter by attributes54s
-
(Locked)
-
-
-
-
-
-