Difference between Select and SelectMany in LINQ in C#

preview_player
Показать описание
Everyone knows what the Select operator does in LINQ but many are not aware of how useful the SelectMany operation can be.

C# Answers provides answers to common questions about the C# language and the related .NET system. Do you have a programming question about C# or .NET that you would like answered?

Add it as a comment below and I try to answer them all!

Рекомендации по теме
Комментарии
Автор

💯Best SelectMany explanation!! Thanks for all the many examples and code!!

kskunk
Автор

muy buena explicación, te mereces mas suscriptores

paolozezar
Автор

Muy buena explicación te mereces mas suscriptores

paolozezar
Автор

Thank you for your clear English and your time.

fkbey
Автор

Thank you very much for this clear explanation

mins_
Автор

what if there are two lists? a list with won years and a list with participated years. selectMany is executed consecutive? so there will be "stupid" duplicates? do you know of a way to achieve such without duplicates?

darkwhite