4
I have two entities, Sistema and Comentario where a system can have several comments:
   public class Sistema
    {
        public ObjectId Id { get; set; }
        [BsonElement("SistemaId")]
        public int SistemaId { get; set; }
        [BsonElement("Key")]
        public int Key { get; set; }
        [BsonElement("Comentarios")]
        public List<Comentario> Comentarios { get; set; }
    }
Entity Comentário:
public class Comentario
{
    public ObjectId Id { get; set; }
    public string Mensagem { get; set; }
    public DateTime DataCriacao { get; set; }
}
The idea is that the end result will look like this:
{
       _id: "3213",
       SistemaId: 11701,
       Key: 01
       comentarios: [
                    {
                      _Id: "1",
                      Mensagem: "Comentário 1",
                      DataCriacao: "2016-07-05"
                    },
                    {
                      _Id: "2",
                      Mensagem: "Comentário 2",
                      DataCriacao: "2016-07-06"
                    }
                  ]
     }
That’s the right way to make this relationship?
Comentariois always subdocused withSistema?– Leonel Sanches da Silva
@Ciganomorrisonmendez Yes
– DiegoAugusto