Entity Framework 4.1 RC:覆盖多对多联接表的名称
在我的代码中,我使用以下方式定义了多对多关系:
modelBuilder.Entity<Post>()
.HasMany( p => p.Authors ).WithMany();
Post.Authors 是用户实体的 ICollection。
模型构建器自动创建一个名为 PostUsers 的表。
如何覆盖表命名约定,以便模型构建器在从模型创建数据库时命名表 PostAuthors?
谢谢!
In my code I have a many to many relationship defined using:
modelBuilder.Entity<Post>()
.HasMany( p => p.Authors ).WithMany();
Post.Authors is an ICollection of User entities.
The ModelBuilder automatically creates a table called PostUsers.
How can I override the table naming convention so that the ModelBuilder names the table PostAuthors when the database is created from the model?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用:
You can use: