I am using this query:
public IEnumerable.....{
var query = from d in Context.Documentos
where d.CodigoEquipamento == documentoDTO.CodigoEquipamento &&
d.Codigo == tipoEquipamentoDTO.Codigo
select new DocumentoDTO
{
Codigo = d.Codigo,
CodigoEquipamento = d.CodigoEquipamento
}
return query.AsEnumerable < DocumentoDTO>();
}
and i get this Error:
ERROR: The entity or complex type 'Model.DocumentoDTO' cannot be constructed in a LINQ to Entities query.
I am using poco, how i can return a collection of my pocos without all fields?