in

CodeSmith Community

Your Code. Your Way. Faster!

entities and foreign keys (from tables)

Last post 12-08-2006 3:37 PM by BNewman. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 12-08-2006 3:37 PM

    • BNewman
    • Not Ranked
    • Joined on 12-08-2006
    • Posts 2
    • Points 10

    entities and foreign keys (from tables)

    HI there,

     If I am defining an EditableRoot object type using 1.53 CSLA framework and I have a table with a foreign key.  Let's say it's Province table with a parent table relationship, Region.  I want to be able to say something like:

     Province.Region.Description_English

    It appears that the generator in CodeSmithTools (via XML) supports ChildCollection, but this forces going to the next row, which seemed the closed to what I wanted except that it shouldn't move to the next row and it also needs to to a Get() on the key and not the DataReader.

    I am wondering if I am missing something to be able to do something as simple as this so that foreign keys are basically interpreted as ParentEntity objects when reading the database.  I should never say:

    Region.GetRegion(Province.Region("province_id")).Description_English   (what a pain that would be!!!)

     Thanks,

     Brendan

    • Post Points: 5
Page 1 of 1 (1 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems