2
I need to convert the SQL script below to Linq.
SELECT 
    [ID_Pessoa], 
    [ID_ArquivoPagamento], 
    SUM([Peculio_Valor]) AS 'Peculio_Valor' 
FROM [VW_PESSOA] 
WHERE   [ID_Pessoa] = @ID_Pessoa AND 
        [ID_ArquivoPagamento] = @ID_ArquivoPagamento  
GROUP BY [ID_Pessoa], [ID_ArquivoPagamento]
Below the code in Linq, but incomplete, because it is not performing the sum of the Savings:
 var reg = (from p in db.VW_PESSOA
            where 
            p.ID_Pessoa == item.ID_Pessoa && 
            p.ID_ArquivoPagamento == ID_ArquivoPagamento
            select new 
            {
                ID_Pessoa = p.ID_Pessoa,
                ID_ArquivoPagamento = p.ID_ArquivoPagamento,
                Peculio_Valor = p.Peculio_Valor
            }).GroupBy(p => new { p.ID_Pessoa, p.ID_ArquivoPagamento});
Have you met the Linqer?
– Jéf Bueno
I don’t know @jbueno
– Gleison França
I’ll take a look
– Gleison França
You want to add by grouping, right?
– Jéf Bueno