Posted 21 Aug 2010 Link to this post
var query = from i
in
scope.Extent<Invoice>()
select
new
{
Id = i.Id,
Code = i.Code,
ContactDescription = i.Contact.Description,
Price = (from ii
i.Invoiceitems select
{ Price = ii.Price * ii.Quantity }).Sum(ii => ii.Price),
DocumentDate = i.DocumentDate
};
Prices = i.Invoiceitems.Sum(p=> (p.Quantity*p.Price)),
Posted 24 Aug 2010 Link to this post