- 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).
- Building a Game with Unity and Blender
- 樂學Web編程:網站制作不神秘
- Apache Hive Essentials
- 軟件測試項目實戰之性能測試篇
- Expert Android Programming
- Securing WebLogic Server 12c
- 精通Python自然語言處理
- 單片機C語言程序設計實訓100例
- Nginx Lua開發實戰
- C++從入門到精通(第5版)
- 零基礎學C語言第2版
- Arduino可穿戴設備開發
- Building Business Websites with Squarespace 7(Second Edition)
- Java 7 Concurrency Cookbook
- React.js實戰