1
A help not to do something much more laborious than it can be right away. I have the following classes in my Model:
public Pessoa {
public int Id { get; set; }
public int TipoPessoaId { get; set; }
public string Nome { get; set; }
public ICollection<Contato> Contatos { get; set; }
public ICollection<Refencia> Referencias { get; set; }
//...
}
public Conjuge {
public int Id { get; set; }
public int PessoaId { get; set; }
public string Nome { get; set; }
public Pessoa Pessoa { get; set; }
//...
}
public Contato {
public int Id { get; set; }
public int PessoaId { get; set; }
public string Anotacao { get; set; }
public string Numero { get; set; }
public Pessoa Pessoa { get; set; }
//...
}
public Referencia {
public int Id { get; set; }
public int PessoaId { get; set; }
public string Nome { get; set; }
public string Anotacao { get; set; }
public Pessoa Pessoa { get; set; }
//...
}
And the question is this: I need to assemble my view (single-page) as follows:
- Campos de Pessoa
- Campos de Conjuge
- Person may have N Contacts
- Add Contact Form for Person
- Person may have N References
- Form Add Reference to Person
But I don’t know the best or least problematic way to start view. But my biggest problem is controller.
Remembering that there are basic things to be taken into account as: contact can only exist if there is the person with id for him, the same is given the reference, and these two cases will be a list that can increase... and as in view assign that list to model?
In my action how would I do it? I mean, I want to know how the view which I think will get complex for the action. It would have to pass a FORM or has how to pass the Object?
Your question is a little confused. You can rephrase it nicely?
– Matheus Bessa
@Matheusbessa I reformulated
– Tafarel Chicotti