EntityFramework 6 RC1 Include on Many-to-Many property fails

房东的猫 提交于 2019-12-01 18:08:28

In rc1 there appears to be a change in naming convention of the junction table in many-to-many associations. When I try your model in various EF versions, this is what I see:

  • EF5 (stable): AgentGroupAgents
  • EF6 (beta): AgentGroupAgents
  • EF6 (rc1): AgentAgentGroups

It wouldn't be bad if the beta was different, but rc1 differs from the last RTM version, which makes this a breaking change. Good catch!

Edit

Answer from the EF team:

Hello,
Prior to EF6 there were some areas of model creation that were non-deterministic - depending on whether you were running on x86 or x64 you could get a different model. The many to many join table name was one of these areas. In EF6 we addressed this to ensure the results would always be the same. Unfortunately, that does mean that for some models (depending on which architecture they were running on) upgrading to EF6 can cause a model change. But the model that is now calculated will be consistent across machines and future versions of EF. If you want to continue using the original name, the best option is to use the Fluent API to specify the join table name.
~Rowan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!