One possible alternative, of several: If you map the tables to different classes and let Foo have a private mapped field of type Bar, you can create get-only "wrapper" properties in Foo that will just call the corresponding property on Bar.
/Oskar 2009/10/24 Dovdimus Prime <[email protected]>: > > Hi guys > > I want to create a class which contains a couple of properties which > will come from a different table. > > So let's say I have a class Foo with properties as follows: > > public string Badda {get;set;} > public string Bing {get;set;} > public string Toodle {get;set;} > public string Pip {get;set;} > > Let's say that Badda and Bing directly match with columns in the > underlying table Foo, but Toodle and Pip come from another related > table, Bar. > > The relationship between tables Foo and Bar is that Bar is a parent of > Foo, so each Foo has one and only one Bar. (So Foo contains a BarId > field). > > I would like the Foo class to pull through the Toodle and Pip > properties from the Bar table, but not be able to update them. How do > I do this? Do I do in the the Foo mapping file? > > Thanks for your help. > > David > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
