How to include tables in a one to one EF Core relationship

0

I need to include the highlighted blue tables for EF Core to make the necessary joins. The PersonFishDocument table has a one-to-one relationship with the highlighted blue tables.

I've already tried using .ThenInclude, but the PersonFishDocument table is already included from the Person class ... How do I do this?

Thank you:)

public Pessoa GetJoinById(int id)
{
    var teste = DbSet
       .Include(pe => pe.PessoaJuridica)
            .ThenInclude(pe => pe.PessoasJuridicasDocumentos)
       .Include(pe => pe.PessoaFisica)
            .ThenInclude(pe => pe.PessoasFisicasDocumentos)
       .Include(pe => pe.PessoasGenericos)
            .ThenInclude(p => p.Filial)
       .Include(pe => pe.PessoasContatos)
       .Include(pe => pe.PessoasEnderecos)
       .Include(pe => pe.PessoasCargos)
       .FirstOrDefault(x => x.Id == id);

    return teste;
}
    
asked by anonymous 01.10.2018 / 00:04

0 answers