Hello,
I need a little help to map the following structure using Fluent NHibernate. The logic behind my classes is to have a question that contains a list of choices and one answer. Each answer contains a sub-list of the choices contained by the question. I hope the code below is more clear
I've minimized the code for each class to contain only the data relevant to this question
class Question {
public virtual int Id { get; set; }
public virtual IList<Choice> Choices { get; set; }
public virtual Answer Answer { get; set; }
}
class Choice {
public virtual int Id { get; set; }
public virtual Question Question { get; set; }
}
class Answer {
public virtual int Id { get; set; }
public virtual IList<Choice> Choices { get; set; }
}
The issue here is how to map the list of choices for the Answer class, so that a choice in the answer will reference the same choice in the question
I'm opened also to suggestions to even change the class structure to achieve the same goal, if you guys have a better idea
Thanks in advance