从多个程序集中查询实体 [英] Querying entities from several assemblies

查看:66
本文介绍了从多个程序集中查询实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在考虑将EF用于我正在开展的一个新项目。我的一个要求是在单独的程序集中定义数据库的子集。
例如,Products表将在程序集A中。整个客户和订单将在程序集B中定义。如果B引用A,则B中的代码是否可能包含在两者之间运行连接的查询产品和订单? EF能否在SQL级别上做到这一点?

希望我有道理:)

Hi,

I'm considering EF for a new project I'm working on. One of my requirements is to define subsets of my database in separate assemblies.

For example, the Products table would be in assembly A whole Customers and Orders would be defined in assembly B. If B references A, is it possible that code in B contains a query that operates a join between Products and Orders? Will EF be capable of doing that at the SQL level?

Hope I made sense :)

推荐答案

如果我理解正确,那么可以做你说的。  您可以拥有相同的模型和ObjectContext,但在不同的程序集中包含实体。 
If i understood u correctly, it is possible to do what you say.  You can have the same model and ObjectContext but have entities in different assemblies. 


这篇关于从多个程序集中查询实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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