Jeff-Lewis / codesmith

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

CSLA: Discrepencies in MemberVariable/Property Case in Some FK Relationships? #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Modifying the example included in Issue 166 where the Invoices table has a
PK on InvoiceId, and InvoiceLines table has a PK on invoiceid+LineNo.

The resulting InvoiceLine.Generated.cs has issues in the factory Get method
due to the differences in capitalization between the two tables (at least
it looks like that is the cause):

            return DataPortal.Fetch< InvoiceLine >(
                new InvoiceLineCriteria { InvoiceId = invoiceId });

should be

            return DataPortal.Fetch< InvoiceLine >(
                new InvoiceLineCriteria { Invoiceid = invoiceid });

where "id" is lowercase.

If the fields in both tables are the same name, but capitalized the same,
it seems to be OK.

Again, this is poor design, but is the result of a legacy database. I can
(and have to this point) created a parallel schema to "correct" these
issues and drive the code generation, but that can be tedious to get around
what may amount to a simple fix in the templates.

Original issue reported on code.google.com by jprice5...@gmail.com on 15 Oct 2009 at 7:56

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 15 Oct 2009 at 8:09

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 19 Oct 2009 at 4:25

GoogleCodeExporter commented 9 years ago
On second look, I'm not so certain this is a simply case issue, but instead it 
looks
like it might be using the column name from the foreign table rather than
local/foreign key.

Original comment by jprice5...@gmail.com on 19 Oct 2009 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 15 Jan 2010 at 9:33

GoogleCodeExporter commented 9 years ago
Hello,

This has been fixed in revision 1279.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 15 Jan 2010 at 10:01

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 23 Feb 2010 at 11:33

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 15 Jul 2010 at 2:22