What is the difference between the two syntaxes with LINQ?

Asked

Viewed 27 times

0

List<string> esportes = new List<string> { "Futebol", "Voleibol", "Basquetebol", "Natação", "Rugby", "Handebol" };
List<string> resultado = new List<string>();

resultado = (from esp in esportes where esp.EndsWith(criterio) select esp).ToList();

resultado = esportes.Where(esp => esp.EndsWith(criterio))
                    .Select(esp => esp).ToList();
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.