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.

Examples of three query expressions

Examples of three query expressions - .NET Tutorial

From the course: .NET Essentials: Working with LINQ

Examples of three query expressions

- [Tutor] Earlier in this chapter, I had this principle or review of these principles where I said, query expressions can be categorized into three areas. What we'll look at in this video is concrete examples of those three areas. So the first area was take an incoming sequence and return a new sequence containing the same element type. Let's see what that means. On line nine I have my data source, which is a list of string. I'm storing it in a variable is of type IEnumerable of string and that's one of the first principles I want to talk about. It's not the container of the sequence that's important. It's the of T part of the sequence is important. So this is of type string and this is a type string and that means they're containing the same element type. So we start out here with this source and then here I'm creating my potential query and notice I'm using select. So that's going to select out a IEnumerable string.…

Contents