fluent nhibernate m-to-m with column
- by csetzkorn
Hi,
I am used to hbm files and started using fluent nhibernate recently.
Creating an m-to-m relationship between two entities A and B is quite simple
In A I create:
public virtual IList Bs { get; set; }
and then I use:
mapping.HasManyToMany(x = x.Bs);
That’s it and I can do:
A a = new A();
a.Bs.Add(b);
My problem is that I would like to have an additional column in my dedicated m-to-m database table which holds the two foreign keys. What is the simplest way to achieve this in FNH?
Would I have to create a dedicated entity for the m-to-m realtionship or is there a simpler solution?
Thanks.
Best wishes,
Christian