NET.Extensions.Database 0.6.6
NET.Extensions.Database
資料庫物件要呼叫上層方法,如下
DbContext(DbContextOptions<DbContext> options) : DbContext(options)
如果是 Code First 可以呼叫以下方法來建立資料表
services
.AddSqliteContext<DbContext, DbOption>(option => option.SQLITE)
.CreateTable<DbContext>();
資料庫移轉
必要條件
要執行指令的專案必須安裝 Microsoft.EntityFrameworkCore.Design (3.1.32) 套件
環境必須安裝 dotnet-ef (3.1.32) 工具
- 安裝
dotnet tool install --global dotnet-ef --version 3.1.32- 更新到 3.1.32
dotnet tool update --global dotnet-ef --version 3.1.32- 移除
dotnet tool uninstall --global dotnet-ef
建立資料庫移轉(每次變更都要產生)
dotnet ef migrations add {變更的描述} --output-dir Migrations --project {擁有 DbContext 的專案} --context {DbContext 的名稱}
執行資料庫移轉(系統啟動後會建立,但更新要手動)
dotnet ef database update --project {擁有 DbContext 的專案} --context {DbContext 的名稱}
移除資料庫移轉(退版)
dotnet ef migrations remove --project {擁有 DbContext 的專案} --context {DbContext 的名稱}
產生移轉的可執行檔
dotnet ef migrations bundle --project {擁有 DbContext 的專案} --context {DbContext 的名稱}
產生移轉的腳本
dotnet ef migrations script --project {擁有 DbContext 的專案} --context {DbContext 的名稱}
Showing the top 20 packages that depend on NET.Extensions.Database.
| Packages | Downloads |
|---|---|
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
177 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
114 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
112 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
106 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
57 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
8 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
6 |
|
NET.Extensions.Database.Sqlite
實作 Sqlite 的 Database 擴充套件
|
5 |
|
NET.Extensions.Database.Sqlite
實作 Sqlite 的 Database 擴充套件
|
2 |
|
NET.Extensions.Database.Sqlite
實作 Sqlite 的 Database 擴充套件
|
1 |
|
NET.Extensions.Database.SqlServer
實作 SqlServer 的 Database 擴充套件
|
1 |
.NET Standard 2.0
- Microsoft.EntityFrameworkCore (>= 3.1.32)
| Version | Downloads | Last updated |
|---|---|---|
| 0.7.2 | 106 | 11/28/2025 |
| 0.7.1 | 6 | 11/28/2025 |
| 0.7.0 | 8 | 11/28/2025 |
| 0.6.9 | 112 | 11/18/2025 |
| 0.6.8 | 177 | 10/29/2025 |
| 0.6.7 | 1 | 10/28/2025 |
| 0.6.6 | 114 | 10/17/2025 |
| 0.6.5 | 57 | 10/15/2025 |
| 0.6.4 | 5 | 09/26/2025 |
| 0.6.3 | 2 | 09/25/2025 |
| 0.6.2 | 2 | 09/24/2025 |
| 0.6.1 | 2 | 09/18/2025 |
| 0.6.0 | 2 | 09/18/2025 |
| 0.0.1 | 1 | 09/18/2025 |