I've tried to map a relationship between 3 classes, but I'm catching up. I have a Person class that represents any Person, an Employee, a Client, a Supplier, any kind of Person, be it physical or legal ... When I register a certain type of person, I will need to use the PersonCadastro table to Note that many fields have a relationship with the PersonId field of tblPeople (except the Id field, as it will only be a PK field and does not relate to any fields), but I can not do with the foreign keys getting right ... The result I got was this:
WhatdoIneedtochangeinmyclassesandmapping?
InthedatabaseIneedthetablestolooklikethis:
public class Pessoa
{
public int PessoaId { get; set; }
public int PessoaTipoId { get; set; }
public virtual PessoaTipo PessoaTipo { get; set; }
public virtual PessoaFisica PessoaFisica { get; set; }
public virtual PessoaJuridica PessoaJuridica { get; set; }
public virtual ICollection<PessoaCadastro> PessoasCadastros { get; set; }
}