AnantLabs / codesmith

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

Child_Update method specifies identity key parameter as output instead of input #480

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. generate switchable BO
2. The table primary key is an identity (int) column
3. The Child_Update() method specifies the ParameterDirection for the primary 
key parameter as output (incorrect). The generated update stored procedure 
generates the primary key parameter as input(correct). This results in an error 
during child_fetch()

What is the expected output? What do you see instead?
Child_Update should specify the primary key parameter direction as input not 
output

What version of the product are you using? Latest 5.2.?

Please provide any additional information below.
I fixed the problem in 
Source/CodeSmith.SchemaHelper.VisualBasicExtensions/MemberCollectionExtensions.c
s. 

Incorrect statement:
 commandParameters += string.Format(Environment.NewLine + "\t\t\t\tcommand.Parameters(\"{0}{1}\").Direction = ParameterDirection.Output", Configuration.Instance.ParameterPrefix, member.ColumnName);

Corrected statement:
                    if (isUpdateStatement)
                        commandParameters += string.Format(Environment.NewLine + "\t\t\t\tcommand.Parameters(\"{0}{1}\").Direction = ParameterDirection.Input", Configuration.Instance.ParameterPrefix, member.ColumnName);
                    else
                        commandParameters += string.Format(Environment.NewLine + "\t\t\t\tcommand.Parameters(\"{0}{1}\").Direction = ParameterDirection.Output", Configuration.Instance.ParameterPrefix, member.ColumnName);

Original issue reported on code.google.com by RichardD...@gmail.com on 5 Aug 2010 at 7:07

GoogleCodeExporter commented 9 years ago
This was found in the released 3.0 CSLA templates for Visual basic.

Original comment by RichardD...@gmail.com on 5 Aug 2010 at 7:15

GoogleCodeExporter commented 9 years ago
Hello,

I'm correct in assuming this is for: EditableChild.StoredProcedures.cst?

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 9 Aug 2010 at 7:30

GoogleCodeExporter commented 9 years ago
Hello,

I'm correct in assuming this is for: EditableChild.StoredProcedures.cst?

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 17 Aug 2010 at 10:35

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

Fixed Issue 480: Child_Update method specifies identity key parameter as output 
instead of input

Original comment by bniemyjski on 24 Aug 2010 at 6:47

GoogleCodeExporter commented 9 years ago
Hello,

Thanks for reporting this. This has been fixed in the latest nightly 
(http://community.codesmithtools.com/nightly/csla/).

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 24 Aug 2010 at 6:48