AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Lists don't call child constructor of switchable objects #530

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a EditableRootList (MyERL)
2. Create a Switchable object (MySWO)
3. Execute the sentence Dim MySWO = MyERL.AddNew()

What is the expected output? What do you see instead?
Expected output is, after creation of MySWO, the property MySWO.IsChild() must 
be true, but is false. As result, when you try to delete an object as child, 
one exception happens "Invalid for root objects - use Delete instead".

What version of the product are you using?
r1887

Please provide any additional information below.
All the switchable objects have two constructors, one NewObjectName() for root 
access, and other NewObjectNameChild() for child access.

The NewObjectName() root constructor call DataPortal.Create and the object is 
not marked as child (OK when the switchable object is root).

The NewObjectNameChild() child constructor call DataPortal.CreateChild and the 
object is marked as child (OK when the switchable object is child).

I think that in the file csla\visualbasic\common\ListAddNewCore.cst the line 
"Dim item As <%= ChildBusinessClassName %> = <%= BusinessProjectName %>.<%= 
ChildBusinessClassName %>.New<%= ChildBusinessClassName %>()" must call "New<%= 
ChildBusinessClassName %>()" when the object is root, or is switchable-root, 
but must call "New<%= ChildBusinessClassName %>Child()" when object is 
switchable-child.

Original issue reported on code.google.com by bernyrod...@gmail.com on 23 Nov 2010 at 8:05

GoogleCodeExporter commented 9 years ago
Hello,

This does sound like it is the case. I'll take a look into this.

Thanks
-Blake

Original comment by bniemyjski on 29 Nov 2010 at 7:22

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2538.

Lists don't call child constructor of switchable objects

Original comment by bniemyjski on 13 Mar 2012 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 13 Mar 2012 at 4:12