Sparkdo.EntityFrameworkCore 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 --version 1.0.1
                    
NuGet\Install-Package Sparkdo.EntityFrameworkCore -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" 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" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.EntityFrameworkCore" />
                    
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 --version 1.0.1
                    
#r "nuget: Sparkdo.EntityFrameworkCore, 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@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&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.EntityFrameworkCore&version=1.0.1
                    
Install as a Cake Tool

Sparkdo.EntityFrameworkCore

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

功能特性

  • Entity Framework Core 数据库上下文抽象
  • 异步查询提供者支持
  • 实体历史记录功能
  • 变更跟踪器支持
  • 全局过滤器支持
  • 分布式事件集成
  • 与 Sparkdo 框架无缝集成

安装

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

核心组件

IEFCoreDbContext

Entity Framework Core 数据库上下文接口,扩展了基础的 DbContext 功能:

  • SaveChangesOnDbContextAsync(): 直接调用 EF Core 的 SaveChangesAsync 方法
  • 完整的实体操作方法(Add, Update, Remove, Attach等)
  • 异步查询支持(FindAsync, FirstAsync等)

DefaultEFCoreAsyncQueryableProvider

Entity Framework Core 异步查询提供者默认实现,提供对 EF Core IQueryable 的异步操作支持:

  • CanExecute(): 检查查询提供者是否可以执行指定类型的查询
  • 完整的异步 LINQ 操作支持(AnyAsync, AllAsync, CountAsync, FirstAsync等)
  • 聚合函数支持(SumAsync, AverageAsync, MinAsync, MaxAsync等)

SparkdoEntityFrameworkCoreModule

Sparkdo Entity Framework Core 模块,负责注册相关服务:

  • IEFCoreDbContextTypeProvider: EF Core 数据库上下文类型提供者
  • IAsyncQueryableProvider: 异步查询提供者
  • IEntityHistoryHelper: 实体历史帮助器
  • SparkdoEFCoreNavigationHelper: EF Core 导航帮助器

扩展性

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

  1. 实现自定义的 IEFCoreDbContext 来提供特定的数据库上下文功能
  2. 实现自定义的 IAsyncQueryableProvider 来提供特定的异步查询功能
  3. 实现自定义的 IEntityHistoryHelper 来提供实体历史记录功能
  4. 通过模块配置添加自定义服务

代码结构说明

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

数据库上下文

  • IEFCoreDbContext: Entity Framework Core 数据库上下文接口
  • ISparkdoEFCoreDbContext: Sparkdo EF Core 数据库上下文接口
  • IEFCoreDbContextTypeProvider: EF Core 数据库上下文类型提供者接口

查询提供者

  • IAsyncQueryableProvider: 异步查询提供者接口
  • DefaultEFCoreAsyncQueryableProvider: 默认 EF Core 异步查询提供者实现

实体历史

  • IEntityHistoryHelper: 实体历史帮助器接口
  • DefaultEntityHistoryHelper: 默认实体历史帮助器实现

变更跟踪

  • IChangeTracker: 变更跟踪器接口
  • DefaultChangeTracker: 默认变更跟踪器实现

全局过滤器

  • IDataFilter: 数据过滤器接口
  • DefaultDataFilter: 默认数据过滤器实现

模块配置

  • SparkdoEntityFrameworkCoreModule: Sparkdo EF Core 模块配置

所有公共接口和类都添加了详细的 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 (11)

Showing the top 5 NuGet packages that depend on Sparkdo.EntityFrameworkCore:

Package Downloads
Sparkdo.EntityFrameworkCore.Sqlite

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

Sparkdo.EntityFrameworkCore.SqlServer

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

Sparkdo.EntityFrameworkCore.MySql

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

Sparkdo.FeatureManagement.EntityFrameworkCore

Sparkdo 功能管理EntityFrameworkCore实现,提供基于EF Core的功能管理数据访问实现

Sparkdo.EntityFrameworkCore.PostgreSql

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2-preview.1 139 12/4/2025
1.0.1 240 11/27/2025
1.0.0 239 11/25/2025
1.0.0-preview.5 92 10/24/2025