EntglDb.Persistence.EntityFramework
0.9.1
dotnet add package EntglDb.Persistence.EntityFramework --version 0.9.1
NuGet\Install-Package EntglDb.Persistence.EntityFramework -Version 0.9.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EntglDb.Persistence.EntityFramework" Version="0.9.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntglDb.Persistence.EntityFramework" Version="0.9.1" />
<PackageReference Include="EntglDb.Persistence.EntityFramework" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EntglDb.Persistence.EntityFramework --version 0.9.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EntglDb.Persistence.EntityFramework, 0.9.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EntglDb.Persistence.EntityFramework@0.9.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EntglDb.Persistence.EntityFramework&version=0.9.1
#tool nuget:?package=EntglDb.Persistence.EntityFramework&version=0.9.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EntglDb.Persistence.EntityFramework
Entity Framework Core persistence provider for EntglDb, supporting SQL Server, PostgreSQL, MySQL, and SQLite.
Features
- ✅ Multi-Database Support: Works with SQL Server, PostgreSQL, MySQL, and SQLite
- ✅ EF Core Integration: Leverage familiar EF Core patterns and migrations
- ✅ Transaction Support: ACID-compliant batch operations
- ✅ Conflict Resolution: Built-in Last-Write-Wins strategy
- ✅ Type-Safe: Strongly-typed entity models
Installation
dotnet add package EntglDb.Persistence.EntityFramework
Quick Start
SQLite
services.AddEntglDbEntityFrameworkSqlite("Data Source=entgldb.db");
SQL Server
services.AddEntglDbEntityFrameworkSqlServer(
"Server=localhost;Database=EntglDb;Trusted_Connection=True;");
PostgreSQL
services.AddDbContext<EntglDbContext>(options =>
options.UseNpgsql("Host=localhost;Database=EntglDb;Username=user;Password=pass"));
services.AddEntglDbEntityFramework();
MySQL
var serverVersion = ServerVersion.AutoDetect(connectionString);
services.AddEntglDbEntityFrameworkMySql(connectionString, serverVersion);
Migrations
Create and apply migrations using EF Core tools:
# Install EF Core tools
dotnet tool install --global dotnet-ef
# Add initial migration
dotnet ef migrations add InitialCreate --context EntglDbContext
# Update database
dotnet ef database update --context EntglDbContext
Custom Configuration
services.AddDbContext<EntglDbContext>(options =>
{
options.UseSqlServer(connectionString);
options.EnableSensitiveDataLogging(); // Dev only
options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
});
services.AddEntglDbEntityFramework();
Performance Considerations
- Query Expressions: Evaluated in-memory. For production workloads with complex JSON queries, use PostgreSQL provider with JSONB support
- Indexing: Create indexes via migrations for better performance
- Batching: EF Core automatically batches multiple operations
Comparison with Other Providers
| Feature | SQLite (Direct) | EF Core | PostgreSQL (EF) |
|---|---|---|---|
| Setup Complexity | Low | Medium | Medium |
| Performance | Excellent | Good | Excellent |
| JSON Queries | SQL Functions | In-Memory | JSONB Native |
| Migrations | Manual | Automated | Automated |
| Multi-DB Support | No | Yes | No |
When to Use
Use EF Core when:
- You need multi-database support
- You want automated migrations
- Your team is familiar with EF Core patterns
- You're building an enterprise application
Use Direct SQLite when:
- You need maximum performance
- You're building a single-node app
- Database portability isn't required
Use PostgreSQL when:
- You need advanced JSON querying
- You're running in production with high load
- JSONB indexes are important
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- EntglDb.Core (>= 0.9.1)
- Microsoft.EntityFrameworkCore (>= 6.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
-
net8.0
- EntglDb.Core (>= 0.9.1)
- Microsoft.EntityFrameworkCore (>= 8.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EntglDb.Persistence.EntityFramework:
| Package | Downloads |
|---|---|
|
EntglDb.Persistence.PostgreSQL
PostgreSQL persistence provider for EntglDb with JSONB support and GIN indexes. |
GitHub repositories
This package is not used by any popular GitHub repositories.