liveBook · Manning

Select

Select is a LINQ sequence operator that applies a selector to each element and returns the resulting projected sequence.

How 3 Manning books explain it

.NET in Action, Second Edition

Select is a LINQ extension method that projects each element of an enumerable sequence into a new form.

How it is used
Projects reflected font properties into names or name-and-font tuples for a web service’s font listing.
How deep it goes
Shows query syntax, its Select method equivalent, and two output shapes; stops short of implementing the extension method.
Examples
Uses PropertyInfo-to-name and PropertyInfo-to-tuple projections while building an ASCII-art font endpoint.
What you can do after
Apply it via LINQ to select the output fields a sequence or service response needs.

Read how .NET in Action, Second Edition explains Select →

Functional Programming in C#, Second Edition

Select is a LINQ extension method that projects each element of a sequence into a new form.

How it is used
Projects sequence, option, and observable values by applying a function to each element.
How deep it goes
Explains projection, query translation, and custom Select methods; distinguishes mapping from flattening with SelectMany.
Examples
Demonstrates doubling a numeric range, mapping timer ticks, and projecting Option values.
What you can do after
Apply it through LINQ's Select to project sequence, option, or observable values with a function.

Read how Functional Programming in C#, Second Edition explains Select →

ASP.NET Core in Action, 3e

A select clause is a LINQ query operation that projects source elements into a specified result shape.

How it is used
Projects EF Core entities into API-facing view models while limiting database columns to those required by the result.
How deep it goes
Explains projection, SQL execution, nested mapping, and client-side fallback for expressions EF Core cannot translate.
Examples
Uses recipe lists, summary view models, detail view models, formatted cooking times, and nested ingredients as projection examples.
What you can do after
Apply it via EF Core to return filtered lists or individual records as efficiently shaped view models.

Read how ASP.NET Core in Action, 3e explains Select →

What to know first

Related concepts

Questions about Select

What is Select?

Select is a LINQ sequence operator that applies a selector to each element and returns the resulting projected sequence.

Which Manning books explain Select?

.NET in Action, Second Edition, Functional Programming in C#, Second Edition and ASP.NET Core in Action, 3e.

What should I know before learning Select?

Manning books that teach Select usually introduce C# and sequence first.

What is Select a kind of?

Select is a kind of extension. An extension is a language feature that lets functionality be defined outside a type's original declaration and called using that type's member-like syntax, without modifying the type.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.