EF4交叉数据库关系 [英] EF4 cross database relationships

查看:125
本文介绍了EF4交叉数据库关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道EF4是否支持跨数据库关系?例如:



db1

 作者
Id
名称

db2

 帖子
ID
内容
db1.Author.Id

在ef4模型中,我需要做些什么才能得到这个关系?



你有什么想法吗?



谢谢

解决方案

我发现 Microsoft Connect中的此条目可以回答有关EF此时提供的支持问题(实际上尚不支持)。



还发现社交MSDN中的一个线程关于这个问题。



堆栈溢出的其他链接:





总之,唯一的替代方案是:


  1. 在EF中使用视图


  2. 使用NHibernate



I was wondering if EF4 support cross-databse relationships? For instance:

db1

Author
  Id
  Name

db2

Posts
  Id
  Content
  db1.Author.Id

What ideally I need to do to get this relation in my ef4 model?

Do you guys have any idea?

Thanks

解决方案

I've found this entry in Microsoft Connect that answers the question about the support given at this moment by EF (actually it is not supported yet).

Also found a thread in Social MSDN about this concern.

Other links on Stack Overflow:

In summary, the only given alternatives are:

  1. Using views in EF

  2. Use NHibernate instead

这篇关于EF4交叉数据库关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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