使用实体框架针对数据库项目进行编程

发布于 2024-12-03 12:33:54 字数 187 浏览 3 评论 0 原文

我正在使用 Visual Studios 2010 创建一个具有数据库的项目。

我决定尝试使用那些允许您在源代码管理中管理数据库以及代码的数据库项目之一。

我还认为我会使用实体框架作为我的数据访问工具。

是否有任何好的解决方案可以将 EF 4.0 项目与数据库项目中管理的数据库联系起来(假设它是一个新数据库)?

Using Visual Studios 2010 I'm creating a project that has a database.

I decided to try to use one of those Database Projects that allow you to manage the database in source control along with the code.

I also think I will use entity framework as my data access tool.

Are there any good solution to tie the EF 4.0 project to the database being managed in the Database project (assuming it's a new db)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凯凯我们等你回来 2024-12-10 12:33:54

您只需使用数据库项目为您创建数据库,然后将数据库优先方法与实体框架结合使用(这意味着您将使用向导和从数据库更新为您创建实体模型)。

You simply use your database project to create database for you and you use Database first approach with Entity framework (that means you will use wizard and update from database to create entity model for you).

薄情伤 2024-12-10 12:33:54

我发现 Scott Guthries 的“代码优先”教程非常好:

http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

让我知道是否不太能解决问题,我还收藏了其他几个。

I found Scott Guthries 'Code-first' tutorial to be quite good:

http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

Let me know if that doesn't quite scratch the itch, I've got a couple of others bookmarked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文