1、安裝get包:(1)、Microsoft.EntityFrameworkCore
(2)、Microsoft.EntityFrameworkCore.Tools
(3)、Microsoft.EntityFrameworkCore.sqlServer.Design
(4)、Microsoft.EntityFrameworkCore.sqlServer
2、工具--> NuGet包管理—>程式包管理器控制臺
3、在控制臺中輸入:Scaffold-DbContext "Data Source=.;Initial Catalog=BroadcastScreen;Persist Security Info=True;User ID=sa;Password=wbf2368864112." Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models!!!
Scaffold-DbContext "Data Source=.;Initial Catalog=BroadcastScreen;Persist Security Info=True;User ID=鏈接資料庫的用戶名;Password=連接資料庫的密碼" Microsoft.EntityFrameworkCore.SqlServer -OutputDir 存放檔案的檔案名
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/288642.html
標籤:.NET Core
