database 如何使用 localdb 在 Code First 中查看数据库图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/13545382/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to view database diagram in a Code First using localdb
提问by Xaqron
I have a Code Firstproject with Entity Framework 5.0.0using localdbcreated in Visual Studio 2012 Ultimate.
Although I can see my class relations in a Class Diagram, how to see a visual diagram of automatic generated database by EF?
我有一个Code First与项目Entity Framework 5.0.0使用localdb中创建Visual Studio 2012 Ultimate。虽然我可以在 a 中看到我的类关系Class Diagram,但如何看到自动生成的数据库的可视化图表EF?
回答by Ralph Lavelle
Install Entity Framework Power Tools Beta 4, restart Visual Studio, right-click on the context in your solution view and you'll see a new 'Entity Framework' option in the context menu. Select 'View Entity Data Model' to see a beautiful visual database diagram in Visual Studio. Voilà!
安装Entity Framework Power Tools Beta 4,重新启动 Visual Studio,右键单击解决方案视图中的上下文,您将在上下文菜单中看到一个新的“实体框架”选项。选择“查看实体数据模型”以在 Visual Studio 中查看漂亮的可视化数据库图表。瞧!
Entity Framework 6 Power Tools: Link
Entity Framework 6 Power Tools:链接
回答by TimS
You can use Microsoft SQL Server Management Studio 2012with localdbwhich supports Database Diagrams in they way you may be used to with other SQL Server database.
您可以使用Microsoft SQL Server Management Studio 2012,localdb它以您可能习惯于其他 SQL Server 数据库的方式支持数据库图表。
- Open Management Studio (should have been installed with Visual Studio)
- Connect to (localdb)\v11.0, with Windows Authentication
- Find the relevant database
- Expand Database Digrams, and install diagram support objects if you've not already
- Add the tables you need and you're done!
- Open Management Studio(应该已经安装了Visual Studio)
- (localdb)\v11.0使用 Windows 身份验证连接到
- 查找相关数据库
- 展开 Database Digrams,如果您还没有安装图表支持对象
- 添加您需要的表格,您就完成了!
Source: This older but still relevant article: http://visualstudiomagazine.com/blogs/data-driver/2012/05/visual-studio-11-beta-easier-development-localdb.aspx
来源:这篇较旧但仍然相关的文章:http: //visualstudiomagazine.com/blogs/data-driver/2012/05/visual-studio-11-beta-easier-development-localdb.aspx
回答by Aecio Lemos
I checked out the Entity Framework Power Tools Beta 4and it is no longer being supported. Intead, you can use the new Entity Framework 6 Power Tools Community Edition.
我检查了Entity Framework Power Tools Beta 4,它不再受支持。此外,您可以使用新的Entity Framework 6 Power Tools Community Edition。
It is supposed to work the same.
它应该是一样的。

