Reputation: 45
I have 3 entites, Test, sections and questions. a test holds many sections, and a section holds many questions.
how do I add a questions property to my Test entity, the property would contain all the questions in all the sections of that test?
Upvotes: 0
Views: 86
Reputation: 364249
You will add non mapped property:
public IEnumerable<Question> Questions
{
get
{
return Sections.SelectMany(s => s.Questions);
}
}
Upvotes: 1