原文鏈接:https://www.entityframeworktutorial.net/code-first/entity-framework-power-tools.aspx
大家好,這里就是EF 6 Code-First 系列的最后一篇文章了。沒有辜負大家的期望,都更新完了,2015年很早的時候,有幾篇沒更新,然后,這次重新把之前的刪掉,學習之后更新的!
EF 6 Code-First系列文章目錄:
- 1 翻譯系列:什么是Code First(EF 6 Code First 系列)
- 2.翻譯系列:為EF Code-First設置開發環境(EF 6 Code-First系列)
- 3.翻譯系列:EF Code-First 示例(EF 6 Code-First系列)
- 4.翻譯系列:EF 6 Code-First默認約定(EF 6 Code-First系列)
- 5.翻譯系列:EF 6中數據庫的初始化(EF 6 Code-First 系列)
- 6.翻譯系列:EF 6 Code-First中數據庫初始化策略(EF 6 Code-First系列
- 7.翻譯系列:EF 6中的繼承策略(EF 6 Code-First 系列)
- 8.翻譯系列: EF 6中配置領域類(EF 6 Code-First 系列)
- 9.翻譯系列:EF 6以及EF Core中的數據注解特性(EF 6 Code-First系列)
- 9.1 翻譯系列:數據注解特性之----Table【EF 6 Code-First 系列】
- 9.2 翻譯系列:數據注解特性之---Column【EF 6 Code First系列】
- 9.3 翻譯系列:數據注解特性之Key【EF 6 Code-First 系列】
- 9.4 翻譯系列:EF 6以及 EF Core中的NotMapped特性(EF 6 Code-First系列)
- 9.5 翻譯系列:數據注解之ForeignKey特性【EF 6 Code-First系列】
- 9.6 翻譯系列:數據注解之Index特性【EF 6 Code-First系列】
- 9.7 翻譯系列:EF數據注解特性之--InverseProperty【EF 6 Code-First系列】
- 9.8 翻譯系列:數據注解特性之--Required 【EF 6 Code-First系列】
- 9.9 翻譯系列:數據注解特性之--MaxLength 【EF 6 Code-First系列】
- 9.10 翻譯系列:EF數據注解特性之StringLength【EF 6 Code-First系列】
- 9.11 翻譯系列:數據注解特性之--Timestamp【EF 6 Code-First系列】
- 9.12 翻譯系列:數據注解特性之ConcurrencyCheck【EF 6 Code-First系列】
- 10.翻譯系列:EF 6中的Fluent API配置【EF 6 Code-First系列】
- 10.1.翻譯系列:EF 6中的實體映射【EF 6 Code-First系列】
- 10.2.翻譯系列:使用Fluent API進行屬性映射【EF 6 Code-First】
- 11.翻譯系列:在EF 6中配置一對零或者一對一的關系【EF 6 Code-First系列】
- 12.翻譯系列:EF 6 中配置一對多的關系【EF 6 Code-First系列】
- 13.翻譯系列:Code-First方式配置多對多關系【EF 6 Code-First系列】
- 14.翻譯系列:從已經存在的數據庫中生成上下文類和實體類【EF 6 Code-First系列】
- 15.翻譯系列:EF 6中的級聯刪除【EF 6 Code-First 系列】
- 16.翻譯系列:EF 6 Code -First中使用存儲過程【EF 6 Code-First系列】
- 17.翻譯系列:將Fluent API的配置遷移到單獨的類中【EF 6 Code-First系列】
- 18.翻譯系列:EF 6 Code-First 中的Seed Data(種子數據或原始測試數據)【EF 6 Code-First系列】
- 19.翻譯系列:EF 6中定義自定義的約定【EF 6 Code-First約定】
- 20.翻譯系列:Code-First中的數據庫遷移技術【EF 6 Code-First系列】
- 20.1翻譯系列:EF 6中自動數據遷移技術【EF 6 Code-First系列】
- 20.2.翻譯系列:EF 6中基於代碼的數據庫遷移技術【EF 6 Code-First系列】
- 21.翻譯系列:Entity Framework 6 Power Tools【EF 6 Code-First系列】
Entity Framework 6 Power Tools是Visual Studio中使用Code-First的時候的設計時的工具。總所周知,Code-First不支持對模型提供圖形化設計的界面。這個工具就是允許你為實體生成設計器、XML、並且DDL SQL。
從這里為Visual Studio 2015/2017下載安裝EF 6 Power Tools. Visual Studio Marketplace.
安裝之后。右鍵上下文類,有下面的功能:
- View Entity Data Model (Read-only)--在實體模型設計器中顯示一個只讀的Code-First模型視圖。
- View Entity Data Model XML--顯示相關的Code-First實體的EDMX XML
- View Entity Data Model DDL SQL--在實體數據模型中,將DDL SQL轉到SSDL。
- Generate Views ---通過EF運行時,生成預編譯的視圖,用來提高啟動的性能。添加生成的視圖文件到項目中。
在Code-First方式中,點擊View Entity Data Model,然后就會為你的所有實體生成只讀的視圖。