I have a Question
class which has a property OptionList
, which is nothing but a List. Questions and Options are stored in diff tables in the db.
Now there are times when I need just the Question object without its Relational Properties, that is properties which are entities mapping to a different table in the db. Thus in this case I do not need OptionList populated.
But then again there are times when I need the OptionList
Property to be populated.
The approach I am thinking of right now is having two different methods.
public Question GetQuestionByID(int qid)
public Question GetQuestionWitOptions(int qid)
So if I call the second metho, I ensure OptionList is populated in the returned Question object.
Is this a good way to achieve such a result? any alternate ideas and suggestions?