I am not sure if I am encountering a bug in CGF or if I just don't know what I am doing (highly likely). I tried looking through the csla samples but the all seem to be more simplistic than this.
I have an object ParentCollection that contains Parent Objects. The Parent Object contains a child ChildCollection of Child Objects.
I am trying to do this:
ParentCollection PC = ParentCollection.NewParentCollection();
Parent P = Parent.NewParent();
ChildCollection CC = P.ChildCollection.AddNew();
//Add stuff to the child collection etc.
I saw this use of the AddNew function in an example somewhere so I have no idea if I am going about this correctly. The AddNew function wants to return a Child Object not a ChildCollection. I have checked over my CGF and they seem right.
Where should I be looking to find this problem.
I have also tried the code below but get an "object referance not set to an instance of an object" error
Child C = Parent.ChildCollection.AddNew();
I also have tried this code below but get an "object referance not set to an instance of an object" error because Parent.ChildCollection is null to start with.
Is there some code that is not generated by CGF that I need to write to make Parent.ChildCollection a new but empty ChildCollection?
I'm thrashing and need a push in the right direction.