开发者

Fluent NHibernate Many-to-Many with Conventions

开发者 https://www.devze.com 2023-02-07 01:42 出处:网络
I have a many to many between two classes: User RetailOutlet It seems that the conventions have specified the RetailOutlet as the owner for the relationship. So when I add a RetailOutlet to the co

I have a many to many between two classes:

  • User

  • RetailOutlet

It seems that the conventions have specified the RetailOutlet as the owner for the relationship. So when I add a RetailOutlet to the collection on the User - nothing happens. I have to set both ends of the relationship.

So I try and override the mappings and:

  • if I specify the ManyToMany from both sides it tells me I've duplicated mappings

  • if I only specify it on one side it 开发者_运维知识库say something similar

I think I need to override the conventions and just tell Fluent to forget any conventions for both these classes.

I could be wrong, setting the ManyToMany in both mapping files is exactly what all the examples on the net do.

cheers


Fixed it. IAutoMappingOverride.

0

精彩评论

暂无评论...
验证码 换一张
取 消