From the course: .NET Essentials: Working with LINQ
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Combine methods with execution pipelines - .NET Tutorial
From the course: .NET Essentials: Working with LINQ
Combine methods with execution pipelines
- [Instructor] I've used the term pipeline or pipelining in this course. Let's spend a few minutes talking about what that means. Typically that means you want to string together a chain of function calls, typically on a single line of code. Now, if you work to C-sharp, in functional programming, we like to avoid statements and we like to have things fit on a single line of code. With the extension methods syntax that's easy to do. So let's see how that works. I start with a list of strings at the top, notice that I have some duplicate strings in here. On line 10, I declare a variable and I call where with the lambda predicated it filters it. But the key thing I want you to see here is that where returns an IEnumerable of T . That means that any of the other methods that work on IEnumerable of T can work with this variable. So that's what I'm doing in the next line of code, I'm taking this pipe 1 calling dot order by on it…
Contents
-
-
-
-
-
-
What sources are queryable?2m 56s
-
The Enumerable class1m 14s
-
Learn how to use the Enumerable static methods3m 14s
-
Learn how to use the Enumerable extension methods1m 3s
-
Learn how to use the Query Expression syntax4m 17s
-
What sources revisited3m 52s
-
Deferred execution: When does the query run?3m 35s
-
Combine methods with execution pipelines2m 19s
-
Combine extension methods and query expressions3m 2s
-
-
-
-
-
-
-
-
-
-
-
-