Something that still isn't clear for me:
If you have, for example, the following structure:
ARecord
{
BRecord B;
}
BRecord
{
CRecord C;
}
CRecord
{
DRecord[] DList;
}
DRecord
{
CRecord CRecord;
}
And I do this:
- Create a new ARecord instance 'A'
- Create a new BRecord instance and assign it to 'A.B'
- Create a new CRecord instance and assign it to 'A.B.C'
-
Create multiple new DRecord instances and add it to the list 'A.B.C.DList'
What do I need to do to save all these new records?
Just 'SaveOrUpdate' A and it'll save all the other records as well?
If not, in what order should I be saving the records?
Also, do I need to set the 'DRecord.CRecord' property to point to its parent myself? Or is this done by itself?
If I need to do this myself, do I need to do it before or after saving the 'A.B.C' record?
What if I remove an item from the list 'A.B.C.DList'?
Do I need to just remove the item from the list and save 'A.B.C'? Or do I also need to remove the DRecord instance myself?
Any aid is GREATLY appreciated - our existing code works but since we were never sure how these things worked I think we're doing too many saves (and cluttering our code because of those)
|