AnantLabs / codesmith

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

Dynamic Root List -- AddNewCore doesn't return value #431

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Generate a dynamic root list.
2. Compile
3.

What is the expected output? What do you see instead?
Expected AddNewCore "return item;" to be generated for the non-silverlight 
method and the method should have a return type of object.
Expected void AddNewCore to be generated for silverlight.

Result. Currently, the AddNewCore doesn't generate a return statement, emits a 
strongly typed statement which doesn't work with DynamicRootLists, and does not 
emits a void AddNewCore method.

What version of the product are you using?
DynamicRootList.Generated.cst Revision 1741

Please provide any additional information below.
If you replace this line:
<% RenderHelper(new AddNewCore(), IncludeSilverlightSupport); %>
With this:
<% RenderHelper(new AddNewCore()); %>
the problem will be resolved.

The ListSimpleAddNewCore.cst only includes the return statement if the 
"IncludeSilverlightSupport" value passed in is FALSE. 

You need to completely different AddNewCore for Silverlight. In Silverlight 
AddNewCore should override the void method with no return value. For other 
contexts you override the method that returns the value.

I have attached a new DynamicRootList.Generated.cst file that makes the 
required changes.

Original issue reported on code.google.com by websitew...@gmail.com on 28 Jun 2010 at 5:04

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 28 Jun 2010 at 5:55

GoogleCodeExporter commented 9 years ago
Hello,

This has been fixed in the latest nightly. However, there seems to be a bug 
with:

Error   2   'Business.Order' does not contain a definition for 
'NewOrder'  C:\Users\Blake\Documents\CodeSmith\Templates\CS_SL_Sample\Business.Se
rver\Collections\OrderList.Generated.cs 101 43  Business.Client

Can someone look into this and log it as a new issue.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 29 Jun 2010 at 12:15

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

Issue 431:  Dynamic Root List -- AddNewCore doesn't return value

Original comment by bniemyjski on 29 Jun 2010 at 12:15