I have some customers and related orders.
Sometimes I want to see all orders for every customer - straightforward enough.
Other times I'd like to see the last order for every customer, if they have no orders I want to see them anyway.
Heres my LINQ pseudo code :
from customers in DataSet.Customers
join orders in DataSet.Orders on customers.CustomerId equals orders.CustomerId
into customerOrders
let customerLastOrder = customerOrders.Select(CustomerId, OrderAmount)
.OrderByDescending(OrderTimestamp)
.GroupBy(CustomerId)
I then want to total all Customer Last Orders.
I'm not quite there as you can see - any help really appreciated.
Thanks, Joe