it is possible to perform a LINQ like this SQL:
select invoice.credit, ((sum(detailsInvoice.amount) - sum(detailsInvoice.discount))+ sum(detailsInvoice.tax)) as total
from detailsInvoice
join invoice on detailsInvoice.invoiceID = invoice.ID
where invoice.carga = 1428 and invoice.ID <> 0
group by invoice.credit
I'm getting this result in the SQL
I spend so much time trying to create a LINQ to perform that query, without luck.