I'm starting a project from scratch and in the middle of modeling the bank, I had a problem. When I built the models , I could not do it right and I ended up confusing everything.
I have student information, occurrences and logins. Where I have several occurrences for a student and several occurrences for a login, to track which login is generating the instance.
But here's my problem: in my student table I have a lot of information like student's name, father's name, mother's name, responsible person's name, contact phone number, primary phone number, contact phone number, p>
I thought of putting the parents' names on a different table, just like the phones, to leave the tables with their respective objections, subjects. That is, organize the subjects. But in doing so, it spawned me several errors when doing scaffolding , since at first it only appeared as dropdown a phone and only the name of the parent. So you're missing data.
How would I do it? Would you leave all the information in one table? That is, would eliminate these tables of phones and parents, and leave this information in a table only, that of students? Or is not separating right by creating these two tables? And how would I do it?
The models :
Student
//Aqui começa a declaração normal dos atributos
public long Id { get; set; }
public string TipoEnsino { get; set; }
public string Nome { get; set; }
public string Endereco { get; set; }
public DateTime DataNascimento { get; set; }
public DateTime AnoLetivo { get; set; }
public int Ano { get; set; }
public string Turma { get; set; }
public int NumeroChamada { get; set; }
public string Foto { get; set; }
public string Observacoes { get; set; }
//Aqui termina
//Aqui começa os relacionamentos
//Ocorrencias
public ICollection<Ocorrencia> Ocorrencias { get; set; }
//Pais
public long PaisId { get; set; }
public Pais Pais { get; set; }
//Telefone
public long TelefoneId { get; set; }
public Telefone Telefone { get; set; }
//Aqui termina
Parents
//Aqui começa a declaração normal dos atributos
public long Id { get; set; }
public string NomePai { get; set; }
public string NomeMae { get; set; }
public string NomeResponsavel { get; set; }
//Aqui termina a declaração
//Aqui começa os relacionamentos
//Aluno
public long AlunoId { get; set; }
public Aluno Aluno { get; set; }
//Aqui termina
Phone
//Aqui começa a declaração normal de atributos
public long Id { get; set; }
public string Contato { get; set; }
public string Alternativo { get; set; }
public string Responsavel { get; set; }
//Aqui termina a declaração normal
//Aqui começa os relacionamentos
//Aluno
public long AlunoId { get; set; }
public Aluno Aluno { get; set; }
//Aqui termina