0
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 columns procedimento
and quant
where competencia = '01/2017'
and producao.id = bpi.idProducao
The sum should be divided by 1111.
To the rest of the division it should be added 1111.
This question of calculating by the 1111, I can do via code.
vc is using C# or VB.net?
– Jeferson Almeida
I’m using C#
– Italo Rodrigo
you can post your production classes and bpi tb, to facilitate the tests
– Jeferson Almeida
I changed the question by adding more information
– Italo Rodrigo
See if Link can be useful to you... I’ve used this software (LINQER), there are some limitations (or I don’t know if I was using it wrong... rsrs) but for me it worked well... https://answall.com/questions/47175/transform-c%C3%B3digo-em-sql-para-Linq? Rq=1
– Alexandre França