Hi all.
I am developing a custom business object model, consisting of 2 objects, Question and Answer. One Question can have many possible Answers. So, the Answer class has a public property called _Question, which should be a reference to the Question object that it belongs to. How can I achieve that? The Answer objects are created through a DataGridView (AddNewCore method), and I don't want to use any values from the presentation layer (i.e. my forms) because that would violate basic principles regarding layered application implementation.
One thought of mine, was to use the question_id (which is a foreign key of the Answer object and is known at the time of the Answer instantiation) to find that object in my system's memory that is running and has this id as its primary key. But, I don't know if I can achieve this.
Can anyone help me with the above? Is the approach correct? If it is, how can I "mess" with my memory space? If not, what would be the best strategy?
Thanks in advance
Lambros