2
I have the Person class that relates to the Personal and Personal Tables in a one-on-one relationship. In my table Person I have the field Personnature where 0 = Person and 1 = Legal Person.
A person can be physical or legal and who defines this is the Personal Fieldnature. There is a way for me to give a include in the Personal table, only if Personnature is equal to 0 and to give a include in the Personal table only for Personnature is equal to 1?
public class PessoaRepository : Repository<Pessoa>, IPessoaRepository
{
public PessoaRepository(SistemaComercialContext context)
:base(context)
{
}
public IQueryable<Pessoa> GetAllJoin()
{
return DbSet //DbSet Pessoa
.Include("PessoaFisica")
.Include("PessoaJuridica")
.AsNoTracking();
}
}
is Entity Framework Core?
– novic