3
In this lambda, 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 cannot be Translated into a store.
How do I fix it?
I did it last night with Entityfunctions, but I’ll consider your answer, Fccdias.
– pnet