Parbad.Storage.EntityFrameworkCore
4.0.0
Prefix Reserved
dotnet add package Parbad.Storage.EntityFrameworkCore --version 4.0.0
NuGet\Install-Package Parbad.Storage.EntityFrameworkCore -Version 4.0.0
<PackageReference Include="Parbad.Storage.EntityFrameworkCore" Version="4.0.0" />
<PackageVersion Include="Parbad.Storage.EntityFrameworkCore" Version="4.0.0" />
<PackageReference Include="Parbad.Storage.EntityFrameworkCore" />
paket add Parbad.Storage.EntityFrameworkCore --version 4.0.0
#r "nuget: Parbad.Storage.EntityFrameworkCore, 4.0.0"
#:package Parbad.Storage.EntityFrameworkCore@4.0.0
#addin nuget:?package=Parbad.Storage.EntityFrameworkCore&version=4.0.0
#tool nuget:?package=Parbad.Storage.EntityFrameworkCore&version=4.0.0
Parbad.Storage.EntityFrameworkCore
Stores the payments and transactions of Parbad, the online payment library for .NET, with Entity Framework Core, in any database that EF Core supports (SQL Server, PostgreSQL, MySQL, SQLite, Oracle, ...).
The package is built against EF Core 8 and works with the EF Core version of your application (8, 9 or 10).
In your application's database
Add Parbad's entities to your own DbContext:
public class ShopDbContext : DbContext
{
public ShopDbContext(DbContextOptions<ShopDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.UseParbad();
}
}
Register the context with AddDbContextFactory (or AddPooledDbContextFactory) and tell Parbad to use it:
using Parbad.Storage.EntityFrameworkCore.Builder;
builder.Services.AddDbContextFactory<ShopDbContext>(options => options.UseSqlServer(connectionString));
builder.Services.AddParbad()
.ConfigureStorage(storage => storage.UseEfCore<ShopDbContext>());
Parbad creates a short-lived context from the factory for each of its operations. It therefore never saves changes
that your code has pending on its own context. AddDbContextFactory also registers ShopDbContext itself, so you can
keep injecting it as before.
Parbad's tables are part of your model, so they are created and updated by your own migrations:
dotnet ef migrations add AddParbad
dotnet ef database update
In a database of its own
Parbad's own ParbadDataContext keeps the tables in a separate database, with separate migrations:
builder.Services.AddParbad()
.ConfigureStorage(storage => storage.UseEfCore(options =>
{
options.ConfigureDbContext = db => db.UseSqlServer(connectionString,
sql => sql.MigrationsAssembly("Shop.Migrations"));
}));
Tables
The tables are payment and transaction in the schema parbad. To change them:
modelBuilder.UseParbad(options =>
{
options.DefaultSchema = "shop";
options.PaymentTableOptions.Name = "parbad_payment";
options.TransactionTableOptions.Name = "parbad_transaction";
});
With ParbadDataContext, set the same properties on the options of UseEfCore(options => ...).
Upgrading from Parbad 3.x
Parbad 4 adds three columns to the payment table: status, refunded_amount and bank_reference. Add a migration
after the upgrade. Existing rows need no data migration: their status follows from their existing columns, and their
refunds from their transactions.
More information
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Parbad.Storage.Abstractions (>= 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0 | 0 | 11/7/2026 |
| 1.7.0 | 53 | 11/5/2026 |
| 1.6.0 | 11,368 | 11/17/2024 |
| 1.5.0 | 711 | 10/28/2024 |
| 1.4.0 | 15,156 | 11/20/2022 |
| 1.3.1 | 14,095 | 5/6/2021 |
| 1.3.0 | 1,371 | 4/10/2021 |
| 1.2.0 | 1,629 | 12/13/2020 |
| 1.1.0 | 3,364 | 7/12/2020 |
| 1.0.6 | 1,050 | 4/17/2020 |
| 1.0.4 | 905 | 4/14/2020 |
| 1.0.3 | 1,031 | 1/18/2020 |
| 1.0.2 | 938 | 12/27/2019 |
| 1.0.1 | 1,046 | 6/18/2019 |
| 1.0.0 | 1,073 | 6/14/2019 |