Skip to content

Instantly share code, notes, and snippets.

@ayende ayende/index.cs
Last active Apr 24, 2016

Embed
What would you like to do?
// map
from order in docs.Orders
from line in order.Lines
select new {
Product = line.Product,
Total = ((line.Quantity * line.PricePerUnit) * (1 - line.Discount))
}
// reduce
from result in results
group result by result.Product into g
select new {
Product = g.Key,
Total = g.Sum(x => x.Total)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.