▪️code first
2023-7-13
| 2025-3-19
字數 210閱讀時間 1 分鐘

新加入 DB

先加入 Context 跟 Model
notion image
 
context:
notion image
 
model:
notion image
 
開啟套件管理主控台:
notion image
 
下命令產生差異檔案
Visual Studio PowerShell:
.Net core CLI:
 
更新 DB
Visual Studio PowerShell:
.Net core CLI:

異動原有DB

修改 model 後
下命令產生差異檔案,更新 DB ,各做一次就好
 

產生 Script

Visual Studio PowerShell:
.Net core CLI:

刪除上一變更

Visual Studio PowerShell:
.Net core CLI:

參考資料:
 
  • EFCore
  • .Net - 同步與非同步Session VS JWT
    Loading...