DKNet.EfCore.Specifications
13.3.1
dotnet add package DKNet.EfCore.Specifications --version 13.3.1
NuGet\Install-Package DKNet.EfCore.Specifications -Version 13.3.1
<PackageReference Include="DKNet.EfCore.Specifications" Version="13.3.1" />
<PackageVersion Include="DKNet.EfCore.Specifications" Version="13.3.1" />
<PackageReference Include="DKNet.EfCore.Specifications" />
paket add DKNet.EfCore.Specifications --version 13.3.1
#r "nuget: DKNet.EfCore.Specifications, 13.3.1"
#:package DKNet.EfCore.Specifications@13.3.1
#addin nuget:?package=DKNet.EfCore.Specifications&version=13.3.1
#tool nuget:?package=DKNet.EfCore.Specifications&version=13.3.1
DKNet.EfCore.Specifications
Compose reusable EF Core queries, runtime predicates and paging through one repository for .NET developers.
✨ Why use it?
- Name reusable filter, include and ordering logic in a specification.
- Use one repository per configured DbContext for reads and tracked writes.
- Build runtime filters with explicit validation and choose offset, streamed or cursor paging.
🚀 Quick Start
Use a .NET 10 console project. Install the packages, then replace Program.cs with the example.
dotnet new console -f net10.0 -n EfCoreDemo
cd EfCoreDemo
dotnet add package DKNet.EfCore.Specifications
dotnet add package Microsoft.EntityFrameworkCore.Sqlite --version 10.0.12
using DKNet.EfCore.Specifications;
using DKNet.EfCore.Specifications.Definitions;
using DKNet.EfCore.Specifications.Extensions;
using DKNet.EfCore.Specifications.Repositories;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using var connection = new Microsoft.Data.Sqlite.SqliteConnection("Data Source=:memory:");
connection.Open();
var services = new ServiceCollection();
services.AddDbContext<DemoDb>(o => o.UseSqlite(connection));
services.AddSpecRepo<DemoDb>();
using var provider = services.BuildServiceProvider();
using var scope = provider.CreateScope();
await using var db = scope.ServiceProvider.GetRequiredService<DemoDb>();
await db.Database.EnsureCreatedAsync();
var repo = scope.ServiceProvider.GetRequiredService<IRepositorySpec>();
await repo.AddRangeAsync(new[]
{
new Product { Name = "Coffee", Price = 12 },
new Product { Name = "Tea", Price = 6 }
});
await repo.SaveChangesAsync();
var rows = await repo.ToListAsync(new MinimumPrice(10));
Console.WriteLine(rows.Single().Name); // Coffee
public sealed class DemoDb(DbContextOptions<DemoDb> options) : DbContext(options)
{
public DbSet<Product> Products => Set<Product>();
}
public sealed class Product
{
public int Id { get; set; }
public string Name { get; set; } = "";
public int Price { get; set; }
}
public sealed class MinimumPrice : Specification<Product>
{
public MinimumPrice(int minimum)
{
WithFilter(p => p.Price >= minimum);
AddOrderBy(p => p.Id);
AsNoTracking();
}
}
Run with dotnet run.
Documentation
| Guide | Read when |
|---|---|
| Package overview | Start with architecture and the end-to-end flow. |
| Compose reusable queries | Configure filters, includes, ordering and tracking. |
| Query and save through a repository | Register repositories, persist changes and own background scopes. |
| Build runtime predicates | Validate caller filters before composing LINQ expressions. |
| Project queries into models | Use Mapster-backed non-tracking model queries. |
| Page and stream results | Choose offset pages, buffered enumeration or keysets. |
| 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.Extensions (>= 13.3.1)
- LinqKit.Microsoft.EntityFrameworkCore (>= 10.0.11)
- Mapster (>= 10.0.13)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- MR.EntityFrameworkCore.KeysetPagination (>= 1.6.0)
- System.Linq.Dynamic.Core (>= 1.7.4)
- X.PagedList.EF (>= 10.6.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DKNet.EfCore.Specifications:
| Package | Downloads |
|---|---|
|
DKNet.EfCore.Repos
Package Description |
|
|
DKNet.AspCore.Extensions
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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.3.1 | 104 | 10/26/2026 |
| 13.3.0 | 144 | 10/22/2026 |
| 13.2.8 | 116 | 10/22/2026 |
| 13.2.7 | 154 | 10/11/2026 |
| 13.2.6 | 99 | 10/10/2026 |
| 13.2.5 | 370 | 10/2/2026 |
| 13.2.4 | 110 | 10/1/2026 |
| 13.2.3 | 113 | 10/1/2026 |
| 13.2.2 | 109 | 10/1/2026 |
| 13.2.1 | 111 | 10/1/2026 |
| 13.2.0 | 103 | 10/1/2026 |
| 13.1.3 | 178 | 9/21/2026 |
| 13.1.2 | 370 | 9/18/2026 |
| 13.1.1 | 115 | 9/18/2026 |
| 13.1.0 | 110 | 9/18/2026 |
| 13.0.2 | 116 | 9/18/2026 |
| 13.0.1 | 115 | 9/18/2026 |
| 13.0.0 | 133 | 9/18/2026 |
| 12.0.0 | 124 | 9/17/2026 |
| 11.0.0 | 192 | 9/17/2026 |