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.
Index into another sequence - .NET Tutorial
From the course: .NET Essentials: Working with LINQ
Index into another sequence
- Up to this point in the course, all of our queries have started with a single input sequence. And we've run a query and we've output our sequence, but we've always had just a single data source. In link you're not restricted to a single data source. There's multiple ways of combining sources. What we'll look at here in this video is one simple way of doing that. I have two sequences, one declared on line two, which is a list of int and one on lines four and five, which is a list of strings. You'll notice that I called the variable foods and my strings represent some food names, apple, banana cherry and so on. Now I have deliberately placed these in alphabetical order so as we start manipulating the data, it's easy to see when we switch around their positions in the output. Let's run the query. Right now I'm calling foods dot dump. And that shows that I have a list of string, there's 10 items. And we're seeing these in…
Contents
-
-
-
-
-
-
-
-
The three types of query expressions2m 16s
-
(Locked)
Review query expression clauses4m 45s
-
(Locked)
Examples of three query expressions3m 16s
-
(Locked)
The select clause6m 26s
-
(Locked)
Learn how to use select to project into another type2m 41s
-
(Locked)
Select into anonymous type2m 16s
-
(Locked)
Learn how to use expressions with select2m 15s
-
(Locked)
Challenge: Write select expressions1m 28s
-
(Locked)
Solution: Write select expressions1m 27s
-
(Locked)
Index into another sequence2m 58s
-
-
-
-
-
-
-
-
-
-