0
I need to order the Personal Collection?
You’re not ordering... Someone knows how to do this?
public Pessoa GetJoinById(int id)
{
var pessoa = Db.Pessoa.Find(id);
Db.Entry(pessoa)
.Collection(x => x.PessoasGenericos)
.Query()
.Include(x => x.Empresa)
.Include(x => x.PessoasSituacoesAnalises)
//.ThenInclude(x=> x.PessoaSituacaoTipo)
.Load();
return pessoa;
}
It’s hard to understand your objects.
– user178974
I updated the @Edney post with part of the class diagram. I’m using EF Core 2.1 and I’m getting a get in the repository. I am including some tables, but in particular, the table "Personal Situacaoanalise", needs to be sorted downwards by date and time using the field Datascheduleanalyze.
– Master JR
It seems that the problem is to sort within Include. Try to do the query without ordering, call . Tolist() and sort the list.
– user178974
As Edney commented, you are ordering only your include, not the full result of the query. But the class relation is confused, present to its entities (the code, not the drawing). [MCVE]
– Leandro Angelo
@Masterjr Managed to solve or quit?
– Leandro Angelo
I left it paused, but I haven’t solved @Leandro Angelo.
– Master JR