Difference Between Select and SelectMany

Posted by Editorial Staff | Updated on

Difference between Select and SelectMany in LINQ. Select is used to select value from a collection whereas SelectMany is used to select values from a collection of collection i.e. nested collection. Select and SelectMany both are projection operators.

SelectMany flattens queries that return lists of lists. For example:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers