实体框架4.1逆向工程code-只实体、框架、工程、code

2023-09-04 03:08:17 作者:愤世俗

我使用实体框架4.1,并想利用自己的code-唯一方法的优势。在位于 http://channel9.msdn.com/Events/TechEd/视频欧洲/ 2010 / DEV212 的起始35:00分钟,这些都显示出反向工程师他们波苏斯从他们现有的数据库的工具。我想这样做,因为我有一个现有的数据库。我已经安装了EF 4.1,我可以创建POCO实体得很好,但我似乎无法找到他们用于从现有数据库中创建波苏斯的工具。当时这个工具没有公布与4.1?

I am using Entity Framework 4.1 and want to take advantage of their code-only approach. In the video located at http://channel9.msdn.com/Events/TechEd/Europe/2010/DEV212 starting at 35:00 minutes in they show a tool that reverse engineers their POCOs from their existing database. I want to do this as I have an existing database. I have installed EF 4.1 and I can create POCO entities just fine but I can't seem to find the tool they used to create POCOs from the existing database. Was this tool not released with 4.1?

在此先感谢。

推荐答案

我已经放弃了code-先一段时间,因为它没有看起来是全功能,因为我所希望的。最近,我有一些时间与EF 4.1多一点玩,检查它的更多细节。我真正相信他们现在所缺乏的是一个数据/架构迁移能力。数据库的该删除和重新还不是很理想的。

Update:

This answer is no longer relevant as EF 5+ is completely full-featured with code-first migration tools.

I had abandoned code-first for a while because it did not appear to be as full-featured as I had hoped. Recently I had some time to play with EF 4.1 a little more and examine it in more detail. All I really believe they are lacking now is a data/schema migration ability. This dropping and recreating of the database is not very ideal.

在我的考试我发现,我问了这个问题的工具确实附带EF 4.1。它被称为ADO.NET的DbContext生成一个code生成模板。它可以通过打开现有的EDMX文件,右键点击你的设计图面,并选择添加code代项目中找到。

In my examination I found that the tool I am asking for in this question was indeed shipped with EF 4.1. It is a code generation template called "ADO.NET DbContext Generator". It can be found by opening up your existing EDMX file, right-clicking your design surface, and selecting "Add Code Generation Item".