C# 14 · Collections and LINQ

Total, average and extremes

Compute simple aggregates over a sequence.

var total = orders.Sum(o => o.Amount);
var average = orders.Average(o => o.Amount);
var largest = orders.Max(o => o.Amount);

Official C# 14 documentation

More collections and linq commands

All collections and linq commands · C# 14 cheatsheet

Was this page helpful?