How to create child objects from a parent class in Asp .Net MVC

0

Greetings, I am trying to make a system of people registration, where a person can have several documents, I would like to know how I can create the documents when creating the person.

Let's say that my Models are this way.

public class Persona()
{
  public int Id {get;set}
  public string Name {get;set}
  public virtual ICollection<Documento> Documentos {get;set}
}

    public class Documento()
{
  public int Id {get;set}
  public string Descripcion{get;set}
  public int PersonaId{get;set}
  public virtual Persona Persona {get;set}
}
    
asked by Fausto Rod 17.07.2017 в 21:24
source

0 answers