In this lambda, it gives me the error below, when it enters the IF:
var resultado = webDB.T_ControleColetor
.Where(cn => cn.CNPJ == cnpj)
.Where(dt => dt.DataControle == DateTime.Now.AddDays(-1))
.Select(x => x.DataControle);
if(resultado.Count() > 0)
{
result = 1;
}
LINQ to Entities does not recognize the method 'System.DateTime AddDays (Double)' method, and this method can not be translated into a store expression.
How do I resolve this?