Tested having problem with relationship between department and employee tables
This returning 2 error: - "EntityType '' has no key defined. Define the key for this EntityType." -Official 'is based on type' Official 'that has no keys defined. And if I put [Key] in both continues the same thing, with msg "ALTER TABLE ALTER COLUMN failed because the 'FuncionnarioID' column does not exist in the 'Official' table." Since it does have the field FuncionarioID,
Department:
public int DepartamentoID { get; set; }
public string DEPARTAMENTO_NOME { get; set; }
public string DEPARTAMENTO_SALA { get; set; }
public string ANDAR { get; set; }
Officer:
public int FuncionnarioID { get; set; }
public string FUNCIONARIO_EMAIL { get; set; }
public string FUNCIONARIO_NOME { get; set; }
public string FUNCIONARIO_CIDADE { get; set; }
public string FUNCIONARIO_ENDERECO { get; set; }
public int DepartamentoID { get; set; }
[ ForeignKey("DepartamentoID")]
public virtual Departamento Departamento { get; set; }