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
|