LINQ aggregate left join on SQL CE
- by P Daddy
What I need is such a simple, easy query, it blows me away how much work I've done just trying to do it in LINQ. In T-SQL, it would be:
SELECT I.InvoiceID, I.CustomerID, I.Amount AS AmountInvoiced,
I.Date AS InvoiceDate, ISNULL(SUM(P.Amount), 0) AS AmountPaid,
I.Amount - ISNULL(SUM(P.Amount), 0) AS AmountDue
FROM Invoices I
LEFT…