DKNet.EfCore.Extensions
10.1.19
dotnet add package DKNet.EfCore.Extensions --version 10.1.19
NuGet\Install-Package DKNet.EfCore.Extensions -Version 10.1.19
<PackageReference Include="DKNet.EfCore.Extensions" Version="10.1.19" />
<PackageVersion Include="DKNet.EfCore.Extensions" Version="10.1.19" />
<PackageReference Include="DKNet.EfCore.Extensions" />
paket add DKNet.EfCore.Extensions --version 10.1.19
#r "nuget: DKNet.EfCore.Extensions, 10.1.19"
#:package DKNet.EfCore.Extensions@10.1.19
#addin nuget:?package=DKNet.EfCore.Extensions&version=10.1.19
#tool nuget:?package=DKNet.EfCore.Extensions&version=10.1.19
DKNet.EfCore.Extensions
The registration/glue package for the DKNet EF Core stack: automatic entity configuration discovery, global
query filters, data seeding, GUID v7 keys, SQL sequences and the SnapshotContext type shared by
DKNet.EfCore.Hooks, DKNet.EfCore.Events, DKNet.EfCore.AuditLogs and DKNet.EfCore.DataAuthorization.
Features
- Auto entity configuration —
UseAutoConfigModel<TContext>()applies everyIEntityTypeConfiguration<T>found in one or more assemblies without manualApplyConfigurationsFromAssemblycalls. DefaultEntityTypeConfiguration<T>— base configuration that wires primary keys (GUID v7 forGuidids), audit columns, and row-version concurrency by convention.- Global query filters —
IGlobalModelBuilder/GlobalQueryFilterfor cross-cutting filters (soft delete, tenant/ownership isolation) applied automatically at model build time. - Data seeding —
IDataSeedingConfiguration/DataSeedingConfiguration<T>, wired into EF Core's native seeding pipeline viaUseAutoDataSeeding. - GUID v7 keys —
GuidV7ValueGeneratorproduces time-ordered GUIDs instead of random ones. - SQL sequences — declare sequences on an enum with
[SqlSequence]/[Sequence], read them withDbContext.NextSeqValue(...)(SQL Server and Npgsql). - Navigation & change-tracking helpers —
IsNewEntity(),AddNewEntitiesFromNavigations(), and relatedEntityEntry/DbContextextensions. - Concurrency-aware
SaveChanges—IEfCoreExceptionHandler+SaveChangesWithConcurrencyHandlingAsync.
Installation
dotnet add package DKNet.EfCore.Extensions
Quick Start
using Microsoft.EntityFrameworkCore;
using DKNet.EfCore.Extensions.Configurations;
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
public DbSet<Product> Products => Set<Product>();
}
public class ProductConfiguration : DefaultEntityTypeConfiguration<Product>
{
public override void Configure(EntityTypeBuilder<Product> builder)
{
base.Configure(builder); // Id (GuidV7 if Guid), audit columns, concurrency token
builder.Property(p => p.Name).HasMaxLength(255).IsRequired();
}
}
// Registration
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(connectionString)
.UseAutoConfigModel<AppDbContext>() // scan + apply configurations
.UseAutoDataSeeding([typeof(AppDbContext).Assembly])); // optional: run seed data
Customisation reference
There is no options class — everything is a registration argument, an attribute, or a virtual member you override.
| Knob | Where | Default | Effect |
|---|---|---|---|
UseAutoConfigModel<TContext>(params Assembly[]?) |
DbContextOptionsBuilder |
[typeof(TContext).Assembly] when no assemblies are passed |
Assemblies scanned for IEntityTypeConfiguration<T>, IGlobalModelBuilder, and [SqlSequence] enums. |
UseAutoDataSeeding(Assembly[]) |
DbContextOptionsBuilder |
not wired | Separate opt-in; attaches discovered IDataSeedingConfiguration types to EF Core's UseSeeding/UseAsyncSeeding. |
AddGlobalModelBuilder<TImplementation>() |
IServiceCollection |
none | Adds a model builder that assembly scanning would not find. Merged and de-duplicated with the scanned ones. |
AddEfCoreExceptionHandler<TDbContext, THandler>() |
IServiceCollection |
none | Registers a keyed IEfCoreExceptionHandler for that DbContext. Idempotent. |
IEfCoreExceptionHandler.MaxRetryCount |
interface default | 3 |
Retry cap for SaveChangesWithConcurrencyHandlingAsync; past it the method returns 0 instead of throwing. |
EfConcurrencyResolution |
handler return value | — | IgnoreChanges, RetrySaveChanges, or RethrowException. |
GlobalQueryFilter.FilterKey |
your override | required | Named EF Core query-filter key. |
GlobalQueryFilter.IsIgnorable |
your override | true |
Whether a specification's IgnoreQueryFilters() may bypass this filter. Override to false for isolation filters. |
IDataSeedingConfiguration.Order |
your override | 0 |
Declared but never read — seeders run in assembly-scan order. |
DefaultEntityTypeConfiguration<T>.Configure |
your override | applies key, audit and concurrency conventions | Call base.Configure(builder) first, then add your own mapping. |
[Sequence] / [SqlSequence] |
DKNet.EfCore.Abstractions |
see that package | Registered only when the provider is SQL Server or Npgsql. |
DefaultEntityTypeConfiguration<T> applies, by reflection: Id as the key (ValueGeneratedOnAdd, plus
GuidV7ValueGenerator for Guid), IAuditedProperties columns (CreatedBy/CreatedOn required, max length
255, insert-only; UpdatedBy max length 255), and IConcurrencyEntity<T>.RowVersion as a row-version
concurrency token.
Full feature guide, composition with Hooks/Events/AuditLogs/DataAuthorization, and gotchas: https://github.com/baoduy/DKNet/blob/main/docs/EfCore/DKNet.EfCore.Extensions.md
| Product | Versions 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. |
-
net10.0
- DKNet.EfCore.Abstractions (>= 10.1.19)
- DKNet.Fw.Extensions (>= 10.1.19)
- Microsoft.EntityFrameworkCore (>= 10.0.11)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.11)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on DKNet.EfCore.Extensions:
| Package | Downloads |
|---|---|
|
DKNet.EfCore.Hooks
DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures. |
|
|
DKNet.EfCore.DataAuthorization
DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures. |
|
|
DKNet.EfCore.Relational.Helpers
DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures. |
|
|
DKNet.EfCore.Specifications
DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures. |
|
|
DKNet.EfCore.Repos
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.19 | 0 | 9/3/2026 |
| 10.1.18 | 0 | 9/3/2026 |
| 10.1.17 | 0 | 9/3/2026 |
| 10.1.16 | 0 | 9/3/2026 |
| 10.1.15 | 111 | 9/1/2026 |
| 10.1.14 | 103 | 9/1/2026 |
| 10.1.13 | 123 | 8/31/2026 |
| 10.1.12 | 226 | 8/25/2026 |
| 10.1.11 | 164 | 8/24/2026 |
| 10.1.10 | 184 | 8/22/2026 |
| 10.1.9 | 202 | 8/22/2026 |
| 10.1.8 | 162 | 8/21/2026 |
| 10.1.7 | 178 | 8/21/2026 |
| 10.1.6 | 172 | 8/21/2026 |
| 10.1.5 | 242 | 8/20/2026 |
| 10.1.4 | 166 | 8/20/2026 |
| 10.1.3 | 181 | 8/19/2026 |
| 10.1.2 | 174 | 8/19/2026 |
| 10.1.1 | 156 | 8/19/2026 |
| 10.0.36 | 160 | 8/18/2026 |