Could you explain what the following LINQ methods OrderBy, Where and Single do and what will be the output of the code?

var phones = new []{ "new", "old", "big", "small" };

Console.WriteLine(phones.OrderBy(p => p.Length).Where(p => p.Length == 5).Single());

Experience Level: Not defined
Tags: .NETC#LINQ

Answer

Comments

No Comments Yet.
Be the first to tell us what you think.