I'm trying to get just 1 record from the Phones and Emails lists.
var lista = Db.Oportunidades
.Include(x => x.Conta.Proprietario)
.Include(x => x.Conta.Contatos.Select(c => c.Telefones))
.Include(x => x.Conta.Contatos.Select(c => c.Emails))
.Include(x => x.Estado)
.Include(x => x.Motivo)
.Include(x => x.Tipo);
I have tried to use First()
, Sigle()
, Take(1)
that generate the error below.
The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties. Parameter name: path
Any tips?