Max

suggest change
var numbers = new[] {1,2,3,4};

var maxNumber = numbers.Max();
Console.WriteLine(maxNumber); //4

var cities = new[] {
    new {Population = 1000},
    new {Population = 2500},
    new {Population = 4000}
};

var maxPopulation = cities.Max(c => c.Population);
Console.WriteLine(maxPopulation); //4000

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


LINQ:
* LINQ
* Any
* Except
* Zip
* Concat
* Count
* Min
* Cast
* All
* Sum
* Take
* OfType
* Max
* Skip
* Last
* Union
* ToList
* Single
* Join
* Empty
* ThenBy
* Range
* Repeat

Table Of Contents