- Mastering Entity Framework Core 2.0
- Prabhakaran Anbazhagan
- 138字
- 2021-07-02 21:16:40
Reverse engineering the database
Reverse engineering can be performed on the NuGet Package Manager console. We have already seen how to open it, so just execute the following command to scaffold the context and models files:
Scaffold-DbContext "Server
(localdb)\mssqllocaldb;Database=MasteringEFCoreDbFirst;
Trusted_Connection=True;"
Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Sometimes we might get errors stating that The package could not be located. The workaround would be opening the project in a separate solution. If we get an Unable to open the database error, then providing access in the SQL Management Studio (connecting the locals from the studio) would resolve the issue. SQL Server Management Studio (SSMS) is a free version and can be downloaded from https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms.
Please refer to the following screenshot:

The scaffolding process generates database context files and corresponding data models (in our case, three files in total).
- Leap Motion Development Essentials
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- 我的第一本算法書
- UI智能化與前端智能化:工程技術、實現方法與編程思想
- Yocto for Raspberry Pi
- 移動界面(Web/App)Photoshop UI設計十全大補
- Apache Kafka Quick Start Guide
- UNIX Linux程序設計教程
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- SciPy Recipes
- Python語言科研繪圖與學術圖表繪制從入門到精通
- H5+移動營銷設計寶典
- Tkinter GUI Application Development Blueprints
- Image Processing with ImageJ(Second Edition)
- Yii框架深度剖析