Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private static void AverageDemo(List<Order> orders)
var averageQuantity = orders.Average(order => order.Quantity);
var totalQuantities = orders.Sum(order => order.Quantity);
var count = orders.Count();
WriteLine($"Average Quantity: {totalQuantities} / {count} = {averageQuantity}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment