CTP5更改为多个默认表名称? [英] CTP5 Change to default table name for many to many?

查看:88
本文介绍了CTP5更改为多个默认表名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的多对多联接表在CTP4中生成为 developers_skills 。现在它在CTP5中以
技能开发者的形式出现。没有看到发布博客文章中记录的这一变化。


如何确定名称,即为什么是技能开发人员而非开发人员技能?

解决方案

Zaphod,


 


我不确定具体规则用于确定连接表名称中的顺序,但我可以找出它是否重要。 
如果您需要更改连接表的名称,那么可以使用OnModelCreating中的流畅API来完成:


 


       
受保护 覆盖
void OnModelCreating( ModelBuilder modelBuilder)


       
{


           
modelBuilder.Entity< 开发人员>()。HasMany(d => d.Skills).WithMany(s => s.Devlopers)。Map(m => m.ToTable(" PanGalacticGargleBlasters" ));


< p style ="margin:0in 0in 0pt">         ;
}


 


希望这有帮助。


 


谢谢,


Arthur < /跨度>

My many to many join table was generated as developers_skills in CTP4. Now it comes out as skilldevelopers in CTP5. Didn't see this change documented in the release blog posts.

How is the name decided i.e why skilldevelopers and not developerskills?

解决方案

Zaphod,

 

I’m not sure of the exact rules that are used to determine the order in the join table name but I can find out if it is important.  If you need to change the name of the join table then it can be done with the fluent API in OnModelCreating:

 

        protected override void OnModelCreating(ModelBuilder modelBuilder)

        {

            modelBuilder.Entity<Developer>().HasMany(d => d.Skills).WithMany(s => s.Devlopers).Map(m => m.ToTable("PanGalacticGargleBlasters"));

        }

 

Hope this helps.

 

Thanks,

Arthur


这篇关于CTP5更改为多个默认表名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆