2
I created a lambda and tried to create an expression or other. With or(||) it didn’t work. Then, instead of || I added Where. Is that right? This way now:
var resultado = db.T_CRM_StatusPDV
.Where(a => a.DT_TransacaoV < diaAnt)
.Where(b => b.DT_ControleV < dataControle)
.Where(c => c.DE_Cnpj == cnpj)
.Select(i => new { i.DE_Cnpj }).ToList();
Better explain the title on the question
– user6026
Ok, if I did so: . Where((a => a.Dt_transacaov < diaAnt)||b => b.Dt_controlev < dataControle). In that case that would not be the expression, but it was just to illustrate. This expression does not work, so I opted for Where. This is for || or for &&
– pnet
It does work! what is Dt_transacaov is a Datetime, and the diaAnt what type is?
– user6026
Datetime also, is a Datetime.Now.Adddays(-1)
– pnet
The chain of
Where
is equivalent to a chain of conditions And and not OR.– Paulo Morgado