Hi,
I'm using Fluent NHibernate and have two tables;
Customer [ID, Name, LanguageID]
Languages [ID, Description]
I have a Customer entity with the following properties; ID, Name, LanguageID, Language
What I would like to do is to join to the Languages table to get the language description and put it in the language property of the customer entity.
I have tried using Join but I can't get it to use the LanguageID field on the customer table to join to the Languages table - it keeps wanting to use 'ID'.
My mapping looks like;
Table("Customers");
Not.LazyLoad();
Id(c => c.ID).GeneratedBy.Assigned();
Map(c => c.Name);
Map(c => c.LanguageID);
Join("Languages", join =>
{
join.KeyColumn("ID");
join.Map(prop => prop.Language).Column("Description");
});