Free NHibernate - HasMany (). WithKeyColumnName

I just got the latest version of Fluent from Google code, and it seems that some changes have been changed since the last time I used it.

I used to be able to match relationships using the following when the identifier I was connecting to had a different name in the second table

HasMany(x => x.Roles).WithTableName("tbl_Roles").WithKeyColumn("RoleId"); 

How is this done in the latest version of Fluent?

thanks

+4
source share
2 answers
 HasMany(x => x.Roles) .WithTableName("tbl_Roles") .KeyColumns.Add("RoleId"); 

Multi-column support was added, so it was necessary to improve the method signature to understand what was going on.

+11
source

This works for me:

 HasMany(x => x.Roles) .WithTableName("tbl_Roles") .KeyColumnNames.Add("RoleId"); 
+8
source

All Articles