I am having a problem whereby the ParentId in a Child Object of a New Parent object is not being refreshed properly when the parent is saved. The Parent.Id is an INT Identity column.
I am using CSLAContrib templates and initially the Child_Insert method is created as follows:
privatevoid Child_Insert(ParentObject parent)
data.ParentObjectID = ReadProperty<int>(ParentObjectIDProperty);
This results in the child record being saved with a ParentObjectID of 0. When I changed this to the following, the child record is saved correctly with the proper ParentObjectID:
Is what I'm doing so far correct? If not, please advise, but if so, do I manually need to update the ParentObjectIDProperty with the correct value after the DataContext.SubmitChanges() method is called as the ParentObject does not contain children with the proper ParentObjectID?
Copyright (c) Marimer LLC