I have a table structure something like this
table Collection
Id
Name
table Product
Id
Name
table Item
Id
Collection_Id
Product_Id
What i would like is to map the Collection above to one single class named:
Class Collection
Id
Name
List<Product> Products
and I have Product class is :
Class Product
Id
Name
How do I do that with fluent nhibernate ? Anyone have any idea ?
What you need is a many to many mapping.
You will need to have a List<> on both classes of the other object and the following mappings in your fluent file
There is a good article about what you are trying to do here