实体框架在多个项目中重用 [英] Entity Framework Reusing across multiple projects

查看:78
本文介绍了实体框架在多个项目中重用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在多个项目中重新使用Entity Framework?有人创建了一个数据库项目,我只能看到项目中的数据库表。 

How can re use Entity Framework across multiple projects ? Someone has created a database projects and all i can see are the database tables in the project . 

我看到该人在他的项目中创建了一个emdx文件,以获取对dbcontext的引用。 

I saw the person created an emdx file in his project to get a reference to the dbcontext . 

但是在我创建一个新的emdx项目之前我无法获得对它的引用。 

But i cannot get a reference to that i guess until i create a new emdx project. 

什么应该是最好的跨项目分享实体框架的方法?

What should be the best approach to share the entity framework across projects?

谢谢。

迎来A

推荐答案

怎么能在多个项目中重用Entity Framework?有人创建了一个数据库项目,我只能看到项目中的数据库表。 

是的,你可以使用WCF服务和多个项目可以使用WCF服务。数据访问层模式和/或存储库模式可以位于WCF服务后面使用 带有数据库的CRUD的ADO.NET实体框架。

Yes you can use a WCF service and multiple projects can consume the WCF service. A Data Access Layer pattern and/or the Repository pattern can be sitting behind the WCF service using  ADO.NET Entity framework for CRUD with a database.


这篇关于实体框架在多个项目中重用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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