[英]Many to Many relationship using SQL and Linq (entity framework/to entities)
I have two tables: 我有两张桌子:
- Attendees
- Events
Normally, I would create a mapping table ' EventAttendeeMap
' to link these tables into a many to many relationship. 通常,我会创建一个映射表'
EventAttendeeMap
'来将这些表链接成多对多的关系。
Is this the best way of doing so? 这是最好的方式吗? Should I store the list of
AttendeeId
s in an xml column instead on the Events table? 我应该将
AttendeeId
列表存储在xml列而不是Events表中吗?
I am using .NET 3.5/4 with Linq as the DAL (although I think this is irrelevant to the design question being asked, possibly). 我使用.NET 3.5 / 4和Linq作为DAL(虽然我认为这与被问到的设计问题无关)。
Interested to see what people's opinions are. 有兴趣了解人们的意见。
Thanks. 谢谢。 Dave
戴夫
映射表绝对是最好的方法 - 实体框架将映射表转换为两侧的实体集合,表本身将基本消失。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.