在.NET实体框架中,有一个(自定义)连接表具有额外属性(除了ids)和/或通过单独的模型将此连接表与其他人联系起来的最佳方法是什么?在Ruby on Rails中,我们可以为连接表建立一个模型,例如:
Item.rb (model)
:has_many => :buyers, :through=>:invoice
...
Buyers.rb (model)
:has_many => :items, :through=>:invoice
...
Invoice.rb (model)
:belongs_to :item
:belongs_to :buyer
....
Run Code Online (Sandbox Code Playgroud)
然后我们可以使用:Item.first.buyers,Buyers.first.items并且Buyer.create(:items=>Item.create(:name=>'random'))当我们使用自动连接表无模型(使用has_and_belongs_to_many)等只是喜欢.
在Visual Studio 2010的"添加关联"对话框中,如果我们选择多重性为*(多个),则无法选择连接表(带有模型).有没有办法手动完成?