I'm having a question, I'm programming with .NET MVC using the Entity Framework. I currently have:
class Produto
{
public int ProdutoId { get; set; }
public string Nome { get; set; }
public string Descricao { get; set; }
public virtual UsuarioSistema CadastradoPor { get; set; }
public virtual UsuarioVisitante CadastradoPor { get; set; }
}
The problem is: the 'RegisteredCode' field must have the FK of the UserAgent or VisitorUser.
The UserEntity Entity has many more attributes than the User Entity Entity, so they are separate.
But even if the UserVisitante is simple and limited, it can also register a product. How should I make the relationship in the Product entity?
class UsuarioVisitante : Usuario
{
public virtual Fornecedor Fornecedor { get; set; }
public virtual ICollection<Produto> Produtos { get; set; }
}