How do i map this in NHibernate
- by Andrew Smith
I Have two classes, Survey and Poll classes. Also I have Question and Question Choice classes. How do I map these so I come out with particular table formats. here is the classes involved.
public class Survey
{
public IList<Question> Questions { get; private set; }
}
public class Poll
{
public Question Question { get; set; }
}
public class Question
{
public string Text { get; set; }
public IList<QuestionChocie> Choices { get; private set; }
}
public class QuestionChoice
{
public string Text { get; set; }
}
The resulting tables that I'm shooting for include the following
Surveys- a table of survey information.
Polls - a table of polls information.
SurveyQuestions -a table of survey questions.
PollQuestions - a table of poll questions.
SurveyChoices - a table of the question choices for the surveys.
PollChoices - a table of the question choices for the survey.
preferably i really want to know for fluent nhibernate, or just mapping xml is fine too.