Sparkdo.EntityFrameworkCore.PostgreSql 1.0.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Sparkdo.EntityFrameworkCore.PostgreSql --version 1.0.1
                    
NuGet\Install-Package Sparkdo.EntityFrameworkCore.PostgreSql -Version 1.0.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="Sparkdo.EntityFrameworkCore.PostgreSql" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.EntityFrameworkCore.PostgreSql" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.EntityFrameworkCore.PostgreSql" />
                    
Project file
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 Sparkdo.EntityFrameworkCore.PostgreSql --version 1.0.1
                    
#r "nuget: Sparkdo.EntityFrameworkCore.PostgreSql, 1.0.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 Sparkdo.EntityFrameworkCore.PostgreSql@1.0.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=Sparkdo.EntityFrameworkCore.PostgreSql&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.EntityFrameworkCore.PostgreSql&version=1.0.1
                    
Install as a Cake Tool

Sparkdo.EntityFrameworkCore.PostgreSql

Sparkdo Entity Framework Core PostgreSQL 集成库,提供与 PostgreSQL 数据库的深度集成支持。

功能特性

  • PostgreSQL 数据库提供程序配置支持
  • 连接字符串验证功能
  • 与 Sparkdo 框架无缝集成
  • 支持 Entity Framework Core 的所有 PostgreSQL 相关功能

安装

<PackageReference Include="Sparkdo.EntityFrameworkCore.PostgreSql" Version="x.x.x" />

核心组件

SparkdoEntityFrameworkCorePostgreSqlModule

PostgreSQL 数据库模块配置类,负责注册 PostgreSQL 相关服务:

  • 替换默认的连接字符串检查器为 PostgreSQL 专用版本
  • 配置顺序 GUID 生成器选项
  • 配置 EF Core 全局过滤器选项

扩展方法

SparkdoDbContextConfigurationContextPostgreSqlExtensions

提供 UseNpgsql 扩展方法,用于配置数据库上下文使用 PostgreSQL 数据库:

  • 支持现有连接和连接字符串两种配置方式
  • 自动配置查询拆分行为
SparkdoDbContextOptionsPostgreSqlExtensions

提供 UseNpgsql 扩展方法,用于配置数据库上下文选项使用 PostgreSQL 数据库:

  • 支持泛型版本,可针对特定 DbContext 类型配置
  • 支持自定义 PostgreSQL 选项配置
SparkdoPostgreSqlModelBuilderExtensions

提供 UsePostgreSql 扩展方法,用于配置模型构建器使用 PostgreSQL 数据库提供程序。

NpgsqlConnectionStringChecker

PostgreSQL 连接字符串检查器,用于验证连接字符串的有效性:

  • 检查数据库连接是否可用
  • 验证指定数据库是否存在

代码结构说明

本项目包含以下主要组件:

扩展方法

  • SparkdoDbContextConfigurationContextPostgreSqlExtensions: 数据库上下文配置扩展
  • SparkdoDbContextOptionsPostgreSqlExtensions: 数据库上下文选项扩展
  • SparkdoPostgreSqlModelBuilderExtensions: 模型构建器扩展

服务实现

  • NpgsqlConnectionStringChecker: PostgreSQL 连接字符串检查器
  • SparkdoEntityFrameworkCorePostgreSqlModule: PostgreSQL 模块配置

配置

  • 通过模块自动注册相关服务和配置

所有公共接口和类都添加了详细的 XML 文档注释,便于开发者理解和使用。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

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
1.0.2-preview.1 136 12/4/2025
1.0.1 125 11/27/2025
1.0.0 129 11/25/2025
1.0.0-preview.5 98 10/24/2025