In LINQ, projection is an operation which converts an object into the new form which holds only those properties which will be subsequently used. By using projection, a developer can create a new type which is built from each object. You are allowed to project property and conduct mathematical function on it, and you can also project the original object without transforming it.
In LINQ, the following projection operations are available:
The SelectMany operator returns sequences of values which are based on the transformation function and then make them into one sequence. Or in other words, we can say, SelectMany operator is used when you want to select values from the multiple collections or if you want a result from the list of the lists and wants to display into a single sequence.
SelectMany in Query Syntax: In Query Syntax, the working of SelectMany operator is achieved by using multiple from clause. As shown in the below example.
SelectMany in Method Syntax: The SelectMany method is present in both the Queryable and Enumerable class and supported by both C# and VB.Net languages.
- LINQ | Projection Operator | Select
- LINQ | Set Operator | Except
- LINQ | Quantifier Operator | Any
- LINQ | Quantifier Operator | Contains
- LINQ | Element Operator | Last
- LINQ | Set Operator | Intersect
- LINQ | Element Operator | First
- LINQ | Set Operator | Union
- LINQ | Filtering Operator | where
- LINQ | Quantifier Operator | All
- LINQ | Set Operator | Distinct
- LINQ | Partition Operator | Take
- LINQ | Element Operator | ElementAt
- LINQ | Grouping Operator | GroupBy
- LINQ | Element Operator | ElementAtOrDefault
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.