English 中文(简体)
是否有可能在实体框架中建立表格和观点之间的联系?
原标题:
  • 时间:2009-05-28 17:31:22
  •  标签:

I have 2 databases (sql server 2005) in my system, one for configuration data and the other one for Application Data, but there are some tables that are needed in both databases. We ve solved that using Synonyms but the problem is when we map the tables in Entity Framework. We have a Language table in the config database, used for localization purposes. But in the application we have a table called "Countries", and it has a child table to contain the country s fields translated. My Entity Framework Context maps tables in the Application database and the only way to map the Languages table from the other database is including a View created in the Application Database. Everything works fine, but when I try to make an Association between the CountryTranslation entity and the Language entity I get this exception:

Problem in Mapping Fragments starting at lines 733, 855: Non-Primary-Key column(s) [pai_codlan] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified.

你们是否知道这是否是一种可能的情况? 我如何解决这个问题?

Thx!

问题回答

Solved! All I had to do was delete the column that was mapped as a Entity Property and just keep the Navigational Property..





相关问题
热门标签