From the course: .NET Essentials: Working with LINQ
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Select into anonymous type - .NET Tutorial
From the course: .NET Essentials: Working with LINQ
Select into anonymous type
- [Instructor] When you work with a relational database and you query a table, you might be working with a table with lots of rows, thousands or millions of rows of data, and that table might also have multiple columns, many columns. I've seen tables with 250 columns. Now, when you write the query in SQL, you can specify the number of rows that you want to return, but you can also specify the number of columns that you want to return. Maybe I only want to see two columns. What we're going to look at in this video is how to do something similar with Link Select. The problem starts here, so I've got this Web Color Class and it has 10 properties. I'm only interested for a query I'm writing in the color name and the hex value. But it doesn't matter. If I query and I return a innumerable of Web Color, I'm going to get all 10 properties populated, with the information from the dataset. And of course, that means two things.…
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
-
-
-
-
-
-
-
-
-
-