From the course: .NET Essentials: LINQ for XML

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Aggregate queries

Aggregate queries - .NET Tutorial

From the course: .NET Essentials: LINQ for XML

Start my 1-month free trial

Aggregate queries

- [Instructor] Link has a number of aggregate query functions that allow us to perform aggregate operations on the results of a query. Typically, this is done after you've generated your query expression and your run your query expression and then you run the aggregate on those results. So in my case, you see here on this part of the code, I'm declaring my query expression. This is the same one we've seen before. It's all the bid price is greater than 12. And then once I have that query, that storage here in this variable, that's my potential query. And then I call the aggregate function on this variable. You'll see what I mean in a minute. So let's select everything, run this. There's five items. Now let's say I wanted to total up the bid prices, I have to pick one of these values, one of these properties. It doesn't make sense to try to do an aggregate saying average value or a sum on card name. No, we won't do…

Contents