Multiple contexts with Entity Framework 6, reference entities across dbcontexts

早过忘川 提交于 2019-12-01 12:23:28

The easiest approach would be to link tables from one database to the other so that this is the database server which handles two physical databases as one virtual database.

Then, in EF, you have just one context with tables from both databases and querying/joins etc. works correctly.

http://msdn.microsoft.com/en-us/library/ff772782.aspx

Otherwise, linking two databases in the application layer with EF and two contexts sounds impossible.

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