Aggregating Sequences

Learn about LINQ extension methods for aggregation functions, including retrieving aggregate information from a table.

Aggregating data with the LINQ extension method

There are LINQ extension methods to perform aggregation functions, such as Average and Sum. Let’s write some code to see some of these methods in action, aggregating information from the Products table:

Step 1: In Program.Functions.cs, add a method to show the use of the aggregation extension methods, as shown in the following code:

Get hands-on with 1400+ tech skills courses.