Closed GoogleCodeExporter closed 9 years ago
Hello,
Thanks for reporting this, I'll take a look and let you know what I find.
Original comment by bniemyjski
on 21 May 2012 at 8:45
This issue was updated by revision r2684.
Fixed some inconsistent naming in the CSLA Templates (Commit 1 of 2).
Original comment by bniemyjski
on 23 May 2012 at 6:35
This issue was updated by revision r2686.
Fixed a bug where associations were getting a crazy names...
The new rules are as follows:
1. If the relationship is a ZeroOrOneToMany, OneToMany, ManyToMany then the
Association's Name and Type name follow the rules specified via configuration
(AssociationTypeNameSuffix and AssociationSuffix).
2. If the relationship is not a ZeroOrOneToMany, OneToMany, ManyToMany, then it
is automatically made Singular!
Original comment by bniemyjski
on 23 May 2012 at 7:26
These issues have been fixed in the latest nightly build. If you run into any
issues. Please let me know...
Original comment by bniemyjski
on 23 May 2012 at 7:26
Hi,
Thanks for your help so far. I tried the latest build out on my real
project. There is one issue that has crept in me thinks. I haven't had a
proper look as yet - will try to do so tomorrow, but just flagging it up.
I have a ReadOnlyChild being generated for my table 'Account'. The class
name is AccountInfo. BUT the synchronous factory methods in the .Generated
class are returning Account.
This is my only instance of this in what is a reasonably large project. Not
sure what is making the Account table so special, but I assume it is the
relationships that are causing this. Once I have a bit more info I'll post
it here.
Original comment by ianmcdid...@gmail.com
on 23 May 2012 at 9:04
I have found that adding a Switchable object for a table that already has a
Read Only Child will cause this. For example I add a ReadOnly child for table
Project. In the ProjectInfo.Generated class the synchronous factory methods
return ProjectInfo. If I now add a Switchable object for table Project and
generate, the ProjectInfo class is affected. It now returns Project instead of
ProjectInfo.
Original comment by ianmcdid...@gmail.com
on 28 May 2012 at 2:19
Hello,
I'm not sure what we can do in this scenario, as we don't know which one should
take precedence. If you are in a read-only business object then we could assume
you want the read only version. Could you add an updated csp for this.
Original comment by bniemyjski
on 28 May 2012 at 4:21
Hi,
Revised project attached that shows the issue. There are two outputs for the
Project table. ReadOnly and Switchable. If you look at the generated ReadOnly
class you will see the factory methods return Project instead of ProjectInfo.
Note that it is the factory methods that I'm talking about here, not the
properties for associated entities. Surely the factory methods should always
return the same type as the class that contains them?
i.e. In Project they should return Project, in ProjectInfo they return
ProjectInfo.
Original comment by ianmcdid...@gmail.com
on 30 May 2012 at 10:40
Attachments:
This issue was updated by revision r2701.
Fixed a bug where factory methods were getting an incorrect type name.
Original comment by bniemyjski
on 31 May 2012 at 6:33
These issues have been fixed in the latest nightly build. If you run into any
issues. Please let me know...
Original comment by bniemyjski
on 31 May 2012 at 6:34
The factory methods change looks good. But, sorry, I have spotted a problem to
do with the original issue (associated child collection properties).
If I add outputs so that I have a ReadOnlyRoot for ProjectStatus and
ReadOnlyList & ReadOnlyChild for Project, there is an issue in the
ProjectStatusInfo.Generated class.
If look at the generated property for Projects it correctly returns a list of
type ProjectInfoList. But the code inside the property works with ProjectList.
i.e.
if(Code.ProjectList.Exists(criteria))
LoadProperty(_projectsProperty, Code.ProjectList.GetByStatusId(ProjectStatusId));
I would expect the lists within the property to be the same type as the
property returns. (For this instance they should all be ProjectInfoList).
The attached project shows the problem.
Original comment by ianmcdid...@gmail.com
on 31 May 2012 at 2:20
Attachments:
This issue was updated by revision r2704.
Fixed a bug with association names inside of properties.
Original comment by bniemyjski
on 31 May 2012 at 5:42
Hello,
I fixed this issue. I did notice that the partial void
OnChildInserting(ProjectStatus projectStatus, S are being generated with the
wrong types. I can't fix that at this point in the release as it is a Massive
change (and shouldn't effect to many people). If you can log it, I'll make sure
its fixed in the next version of the templates.
Original comment by bniemyjski
on 31 May 2012 at 5:43
Original issue reported on code.google.com by
ianmcdid...@gmail.com
on 18 May 2012 at 11:10Attachments: