I have 2 tables (Labour and LabourPosition). Instead of having a fki to the LabourPosition table from the Labour table, I'd like to use an object (theLabourer.LabourPosition.Name
instead of getLabourPosition(theLabourer.LabourPositionId)
.
I've read a few articles to do this but they don't seem to be working for me... the error I get when trying to view the value of the LabourPosition property is "Could not initialize proxy - no Session".
My mapping (p.s: LabourPosition does not have a fki back to Labour, one way only): LabourMap class:
References<LabourPosition>(x => x.LabourPosition, "LabourPositionsId");
And then obviously I've defined the property in the Labour entity as:
public virtual LabourPosition LabourPosition { get; set; }
Any ideas? Help would be appreciated!