I have two classes:
Produção
{
int id,
procedimento int,
quant int
string competencia
}
bpi
{
int id,
ini idProducao
}
How to convert the code below to LINQ
?
select ((sum(procedimento) + sum(quant)) mod 1111) + 1111 from producao
left join bpi
on producao.id = bpi.idProducao
where competencia = '01/2017'
The goal is to sum all the values of the procedimento
and quant
columns where competencia = '01/2017'
and producao.id = bpi.idProducao
The sum should be divided by 1111.
The rest of the division should be added to 1111.
This question of calculating for 1111, I can do via code.