Franz.Common.EntityFramework.PostGres
1.2.64
dotnet add package Franz.Common.EntityFramework.PostGres --version 1.2.64
NuGet\Install-Package Franz.Common.EntityFramework.PostGres -Version 1.2.64
<PackageReference Include="Franz.Common.EntityFramework.PostGres" Version="1.2.64" />
paket add Franz.Common.EntityFramework.PostGres --version 1.2.64
#r "nuget: Franz.Common.EntityFramework.PostGres, 1.2.64"
// Install Franz.Common.EntityFramework.PostGres as a Cake Addin #addin nuget:?package=Franz.Common.EntityFramework.PostGres&version=1.2.64 // Install Franz.Common.EntityFramework.PostGres as a Cake Tool #tool nuget:?package=Franz.Common.EntityFramework.PostGres&version=1.2.64
Franz.Common.EntityFramework.Postgres
A dedicated library within the Franz Framework that extends Entity Framework Core support for PostgreSQL using the Npgsql.EntityFrameworkCore.PostgreSQL provider. This package simplifies PostgreSQL configuration and integration for .NET applications, supporting both single-tenant and multi-tenant environments.
Features
- PostgreSQL Integration:
- Leverages
Npgsql.EntityFrameworkCore.PostgreSQL
for robust PostgreSQL database support.
- Leverages
- Service Registration:
ServiceCollectionExtensions
to streamline dependency injection for PostgreSQL database contexts.
- Multi-Tenancy Support:
- Full integration with
Franz.Common.MultiTenancy
for tenant-based database configurations.
- Full integration with
- Compatibility:
- Seamless integration with Franz.Common.EntityFramework for shared utilities, repository patterns, and extensions.
Version Information
- Current Version: 1.2.64
- Part of the private Franz Framework ecosystem.
Dependencies
This package relies on:
- Npgsql.EntityFrameworkCore.PostgreSQL (8.0.0): Official EF Core provider for PostgreSQL.
- Franz.Common.EntityFramework: Core EF utilities and repository patterns.
- Franz.Common.MultiTenancy: Multi-tenancy support for PostgreSQL databases.
Installation
From Private Azure Feed
Since this package is hosted privately, configure your NuGet client:
dotnet nuget add source "https://your-private-feed-url" \
--name "AzurePrivateFeed" \
--username "YourAzureUsername" \
--password "YourAzurePassword" \
--store-password-in-clear-text
Install the package:
dotnet add package Franz.Common.EntityFramework.Postgres --Version 1.2.64
Usage
1. Configuring PostgreSQL Context
Define a DbContext
for PostgreSQL integration:
using Microsoft.EntityFrameworkCore;
public class PostgresDbContext : DbContext
{
public PostgresDbContext(DbContextOptions<PostgresDbContext> options) : base(options) { }
public DbSet<Order> Orders { get; set; }
}
2. Dependency Injection
Use ServiceCollectionExtensions
to register PostgreSQL database contexts:
using Franz.Common.EntityFramework.Postgres.Extensions;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddPostgresDbContext<PostgresDbContext>(options =>
options.UseNpgsql(
"Host=localhost;Database=MyDatabase;Username=my_user;Password=my_password"
));
}
}
3. Multi-Tenancy Support
Integrate with Franz.Common.MultiTenancy
to support multi-tenant PostgreSQL configurations:
using Franz.Common.MultiTenancy;
using Franz.Common.EntityFramework.Postgres.Extensions;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMultiTenantPostgresDbContext<PostgresDbContext>(tenantOptions =>
{
tenantOptions.ConnectionStringResolver = tenantId =>
$"Host=localhost;Database=Tenant_{tenantId};Username=my_user;Password=my_password";
});
}
}
Integration with Franz Framework
The Franz.Common.EntityFramework.Postgres package integrates seamlessly with:
- Franz.Common.EntityFramework: Shared repository patterns and utilities.
- Franz.Common.MultiTenancy: Simplifies tenant-specific database configurations.
Ensure these dependencies are installed to leverage the library's full capabilities.
Contributing
This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:
- Clone the repository. @ https://github.com/bestacio89/Franz.Common/
- Create a feature branch.
- Submit a pull request for review.
License
This library is licensed under the MIT License. See the LICENSE
file for more details.
Changelog
Version 1.2.64
- Upgrade version to .net 9
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- Franz.Common.EntityFramework (>= 1.2.64)
- Franz.Common.MultiTenancy (>= 1.2.64)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.