天天看點

【abp vnext 實戰系列】簡單的内容管理系統:初始化資料庫

PS:文檔位址 https://docs.abp.io/zh-Hans/abp/latest/Data-Access

1-生成資料庫腳本

1.1-遷移指令知識點

https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/managing?tabs=vs

https://www.cnblogs.com/yaopengfei/p/11633385.html

1.2- 執行以下指令,生成腳本

Add-Migration Init

1.2.1 第一次執行提示錯誤

Your startup project 'GR.CMS.Web' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.

根據提示我們需要安裝 Microsoft.EntityFrameworkCore.Design 類庫

1.3-執行以下指令,建立更新資料庫

Update-Database

【abp vnext 實戰系列】簡單的内容管理系統:初始化資料庫

2-根據生成的DEMO,配置子產品

【abp vnext 實戰系列】簡單的内容管理系統:初始化資料庫

t01-t02 表示t02 有引用t01 的類庫 u0x 一樣

2.1 删除之前生成的腳本,重複1.2,1.3 動作生成新的資料庫

【abp vnext 實戰系列】簡單的内容管理系統:初始化資料庫

PS:接下來就是實作互動的了

漫漫人生,唯有激流勇進,不畏艱險,奮力拼搏,方能中流擊水,抵達光明的彼岸

繼續閱讀