AnantLabs / codesmith

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

CSLA templates - C# - "SELECT" statement for Parameterized SQL DataPortal Update methods is incorrect when primary key is a GUID #413

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a database containing a table with a GUID primary key.
2. Create a 2nd table, also with a GUID primary key & make a foreign key back 
to the 1st table.
3. Generate the project & try to update.

What is the expected output? What do you see instead?
The code throws an exception in e.g. the Child_Update method when it tries to 
get the "ID" field from the data reader, after posting the update. This is 
because the "SELECT" statement doesn't include the "ID" field in the field list.

What version of the product are you using?
CodeSmith 5.2.1
CSLA templates r1706

Please provide any additional information below.
Problem is in the "BuildUpdateSelectStatement" method of EntityExtensions.cs 
(CodeSmith.SchemaHelper.Extensions project).
Fixed version attached (but needs more testing)

Original issue reported on code.google.com by rlbrac...@gmail.com on 17 Jun 2010 at 4:35

Attachments:

GoogleCodeExporter commented 9 years ago
Hello,

This has been fixed in revision 1717. I reviewed your changes and they looked 
good.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 19 Jun 2010 at 8:27

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 21 Jun 2010 at 8:08