zengcheng / codesmith

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

CSLA - Child_Update method doesn't have enough arguments when a table has 2 foreign keys back to the same "parent" #418

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a database with at least 2 tables.
2. Add 2 foreign key relationships from one table back to the other.
3. Generate the CSLA objects.

What is the expected output? What do you see instead?
The Child_Update method for the "child" table only has 1 parameter for a parent 
object. It uses this parameter for both of the "parent" properties.

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

Please provide any additional information below.
In the attached project, the "Persons" table contains 2 references to the 
"Addresses" table. When the code is generated, the Child_Update method in 
Person.DataAccess.cs only has 1 Address parameter.

Original issue reported on code.google.com by rlbrac...@gmail.com on 18 Jun 2010 at 2:52

Attachments:

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Hello,

Unfortunately this is a very complex problem that is very hard to solve in the 
CSLA Code Gen world, due to all the different business object types. If you 
would like to work on resolving this bug in the templates it would be greatly 
appreciated. I'm going to label this as something we may work on in the future. 
The only way to resolve this in the short term is to implement the on partial 
methods in the partial non generated class and copy/paste code and do a little 
bit of editing.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 8 Jul 2010 at 6:25