Reputation: 41
parcelas = (from docuRec in Dados.DOCUREC
where docuRec.CODALUNO == codAluno && docuRec.CODESCOLA == codEscola &&
(configBoleto.DtVencimentoInicial >= (docuRec.VENCESP != null ?
new DateTime(docuRec.DTVENCIMENTO.Year, docuRec.DTVENCIMENTO.Month, docuRec.VENCESP.Value) :
docuRec.DTVENCIMENTO))
select docuRec);
Only parameterless constructors and initializers are supported in LINQ to Entities
Can anybody help me?
Upvotes: 4
Views: 4261
Reputation: 8564
In L2E you must have all your entities defining at least one parameterless constructor. That's necessary because the serializer must create an instance of your object and it doesn't know what parameters to pass;
The serializer then sets each property individually.
My guess is that Dados.DOCUREC
doesn't define such a constructor.
Upvotes: 3