nhibernate - FluentNhibernate Mapping of lookup table in to properties of Parent Object -
using fluentnhiberante there way map following:
parent table (employee)
employeeid int primary key firstname lastname employeetypeid
lookup table (employeetype)
employeetypeid int primary key employeetypedescription
my class defined as:
public class employee { int employeeid {get; set;} ... string employeetypedescription {get; set;} }
is there way via fluentnhibernate mapping populate employeetypedescription property in employee object employeetypedescription table looking using employeetypeid column in employee?
i'm pretty sure normal , proper way using references in mapping file , adding employeetype property employee class , accessing description using employee.employeetype.employeetypedescription. i'm unable change code @ time wondering how set employeetypedescription property now.
it should possible tweaking examplecode below:
public class employeemap : classmap<employee> { public employeemap() { ... join("employeetype", join => { join.keycolumn("employeetypeid"); join.map(k => k.therapieok, "somecolumn")); } ... } }
Comments
Post a Comment