I have this class which i would like to map:
public class Contract
{
public virtual IList<Right> RightsSystem1 { get; set; }
public virtual IList<Right> RightsSystem2 { get; set; }
}
With mapping:
HasManyToMany(c => c.RightsSystem1).Not.LazyLoad();
HasManyToMany(c => c.RightsSystem2).Not.LazyLoad();
Where Right is another mapped class which represents certain rights two diffrent systems have (it can be like “GetPartStockQuantity” or “GetOrderStatus“).
The problem im having is that when i add one right to each of the two lists and then getting them with NHibernate both of the lists have two items (which are the two i added seperately).
How can i solve this?
both manytomany default to the same table and column names. you need to specify them explicitly: