Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Latest commit

 

History

History
29 lines (16 loc) · 1.35 KB

projections-5.md

File metadata and controls

29 lines (16 loc) · 1.35 KB

LINQ - Projection Operators

The select clause of a LINQ query projects the output sequence. It transforms each input element into the shape of the output sequence

Compound select with where and assignment

This sample uses a compound from clause to select all orders where the order total is greater than 2000.00 and uses from assignment to avoid requesting the total twice.

Compound select with multiple where clauses

This sample uses multiple from clauses so that filtering on customers can be done before selecting their orders. This makes the query more efficient by not selecting and then discarding orders for customers outside of Washington.

Compound select with index

This sample uses an indexed SelectMany clause to select all orders, while referring to customers by the order in which they are returned from the query.

Next: Partition operators » Previous: Restrictions from multiple inputs «

Home