Sparkdo.EntityFrameworkCore.Sqlite 1.0.0-preview.5

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

Sparkdo.EntityFrameworkCore.Sqlite

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

功能特性

  • SQLite 数据库上下文配置扩展
  • 线程安全的 SQLite 命令执行
  • 单元测试专用的 SQLite 连接实现
  • 与 Sparkdo 框架无缝集成

安装

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

核心组件

SparkdoDbContextConfigurationContextSqliteExtensions

SQLite 数据库上下文配置扩展类,提供便捷的 SQLite 配置方法:

  • UseSqlite(): 配置使用 SQLite 数据库,支持连接字符串和现有连接对象

SparkdoDbContextOptionsSqliteExtensions

SQLite 数据库上下文选项扩展类,提供便捷的 SQLite 选项配置方法:

  • UseSqlite(): 配置使用 SQLite 数据库,支持泛型上下文类型

SparkdoEntityFrameworkCoreSqliteModule

Sparkdo Entity Framework Core SQLite 模块,负责注册 SQLite 相关的服务和配置:

  • 配置 EF Core 全局过滤器选项,启用数据库函数支持

SparkdoSqliteCommand

线程安全的 SQLite 命令实现,通过信号量确保 SQLite 命令执行的线程安全性:

  • 重写 Connection 属性,确保连接设置的线程安全
  • 重写 Dispose 方法,确保资源释放的线程安全

SparkdoUnitTestSqliteConnection

单元测试专用的 SQLite 连接实现,解决 SQLite 在并发测试中的线程安全问题:

  • 继承自 SqliteConnection,提供线程安全的命令创建
  • 返回线程安全的 SparkdoSqliteCommand 实例

扩展性

该库提供了完整的 SQLite 集成功能实现,可以通过以下方式扩展:

  1. 实现自定义的数据库配置扩展方法
  2. 实现自定义的 SQLite 命令执行逻辑
  3. 实现自定义的连接管理策略

代码结构说明

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

数据库配置扩展

  • SparkdoDbContextConfigurationContextSqliteExtensions: 数据库上下文配置扩展
  • SparkdoDbContextOptionsSqliteExtensions: 数据库上下文选项扩展

模块配置

  • SparkdoEntityFrameworkCoreSqliteModule: SQLite 模块配置

线程安全实现

  • SparkdoSqliteCommand: 线程安全的 SQLite 命令
  • SparkdoUnitTestSqliteConnection: 单元测试专用 SQLite 连接

所有公共接口和类都添加了详细的 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 133 12/4/2025
1.0.1 176 11/27/2025
1.0.0 183 11/25/2025
1.0.0-preview.5 87 10/24/2025