NHibernate: Many-to-many relationship with field in the relationship table

后端 未结 2 771
孤城傲影
孤城傲影 2020-12-06 07:50

I\'m scratching my head; I have a Car table and a Customer table that have a many-to-many relationship. In this relationship table I want to add a column that can tell me wh

2条回答
  •  无人及你
    2020-12-06 08:23

    Make the relationship an entity:

    class CarRelation
    {
      Car Car {get; set; }
      RelationType Type {get; set;}
    }
    

    A pure many-to-many relation doesn't have any additional properties.

提交回复
热议问题