Ardalis.Specification
10.0.0
dotnet add package Ardalis.Specification --version 10.0.0
NuGet\Install-Package Ardalis.Specification -Version 10.0.0
<PackageReference Include="Ardalis.Specification" Version="10.0.0" />
<PackageVersion Include="Ardalis.Specification" Version="10.0.0" />
<PackageReference Include="Ardalis.Specification" />
paket add Ardalis.Specification --version 10.0.0
#r "nuget: Ardalis.Specification, 10.0.0"
#:package Ardalis.Specification@10.0.0
#addin nuget:?package=Ardalis.Specification&version=10.0.0
#tool nuget:?package=Ardalis.Specification&version=10.0.0
Ardalis.Specification
IMPORTANT This is the last MIT-licensed release of this library. Future releases will require a (potentially free) commercial license. Find out more
A .NET library for building query specifications.
A specification pulls query logic (filtering, ordering, includes, paging, and projections) out of controllers, services, and custom repository methods into small, named, reusable classes. A handful of generic repository methods can then run any specification, which removes most duplicated LINQ expressions and custom query methods. Companion packages provide evaluators and a ready-to-use RepositoryBase<T> for EF Core (Ardalis.Specification.EntityFrameworkCore) and EF6 (Ardalis.Specification.EntityFramework6).
Release Notes
This is the last MIT-licensed release of this library (see above).
- Updated to the latest supported .NET frameworks (.NET 10, .NET 11) with continued NetStandard2.0 support (#553)
- Breaking: dropped the
net8.0andnet9.0targets (.NET 8 and 9 are out of support). Projects that can't use .NET 10+ get thenetstandard2.0build ofArdalis.Specificationinstead. - Breaking (Ardalis.Specification.EntityFrameworkCore): now targets
net10.0andnet11.0only, and requires EF Core 10 or 11. Ardalis.Specification.EntityFramework6keeps itsnet472target for .NET Framework apps.
- Breaking: dropped the
- Updated all NuGet dependencies (#553)
- NuGet package now ships its own focused readme
Usage
Define a specification:
using Ardalis.Specification;
public class ActiveCustomersByNameSpec : Specification<Customer>
{
public ActiveCustomersByNameSpec(string name)
{
Query.Where(c => c.IsActive && c.Name.StartsWith(name));
Query.OrderBy(c => c.Name);
Query.Include(c => c.Addresses);
}
}
Then pass it to a repository:
// RepositoryBase<T> comes from Ardalis.Specification.EntityFrameworkCore
public class Repository<T>(AppDbContext dbContext)
: RepositoryBase<T>(dbContext), IRepositoryBase<T> where T : class
{
}
var spec = new ActiveCustomersByNameSpec("Ard");
List<Customer> customers = await repository.ListAsync(spec, cancellationToken);
See the Ardalis.Specification documentation for the full usage guide.
Roadmap
This is our roadmap for this package:
Version 10.x
This version. The last MIT-licensed package.
Version 15.x
The next version. It will have minimal changes from 10.x but will have a dual license and a compile-time license check and any planned breaking changes will be marked [Obsolete] if possible to signal what's coming. It will also be released both as Ardalis.Specification and as NimbleTools.Specification but with identical behavior to make upgrades as easy as possible, both now and in the future.
Why the jump from 10 to 15? We want to consolidate the 3 Ardalis packages that are moving to commercial licensing (GuardClauses, SmartEnum, Specification) and, like Aspire, we want to keep our version numbers separated from .NET's version numbers. Starting at 15 for all 3 lets us do that.
Version 16.x
This is where we expect to introduce potentially breaking changes as we rethink, refactor, and improve the implementation of the library. We will not break the API without a good reason, but there are some inconsistencies and places where we can improve the usability and sometimes the performance and this will be the time to make such changes.
Stay informed of changes by adding your email here: https://nimbletools.io/updates
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Buffers (>= 4.6.1)
- System.Memory (>= 4.6.3)
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
NuGet packages (169)
Showing the top 5 NuGet packages that depend on Ardalis.Specification:
| Package | Downloads |
|---|---|
|
Ardalis.Specification.EntityFrameworkCore
EF Core plugin package to Ardalis.Specification containing EF Core evaluator and abstract repository. |
|
|
Ardalis.SharedKernel
An example shared kernel project/package for use with Ardalis.CleanArchitecture template. You should probably replace this with your own package! |
|
|
Genocs.Core
Core building blocks and abstractions for Genocs-based applications. |
|
|
Delfin.Core.Shared
A versatile library for .NET applications that promotes code reuse and maintainability. It includes common utilities, extension methods, shared data models, logging integration, and configuration helpers. |
|
|
Shinya.Domain
Shinya.Framework |
GitHub repositories (13)
Showing the top 13 popular GitHub repositories that depend on Ardalis.Specification:
| Repository | Stars |
|---|---|
|
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
|
|
|
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 8.0 reference application, now community supported: https://github.com/NimblePros/eShopOnWeb
|
|
|
neozhu/CleanArchitectureWithBlazorServer
This repository is designed to create an enterprise Blazor Server application that follows the principles of Clean Architecture and implements Blazor Clean Architecture best practices for scalability, maintainability, and testability.
|
|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 10, Wolverine, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
|
NimblePros/eShopOnWeb
Sample ASP.NET Core 10.0 reference application, powered by Microsoft, demonstrating a domain-centric application architecture with monolithic deployment model.
|
|
|
ShawnShiSS/clean-architecture-azure-cosmos-db
A starting point to build a web API to work with Azure Cosmos DB using .NET 5 and Azure Cosmos DB .NET SDK V3, based on Clean Architecture and repository design pattern. Partition key is also implemented through the repository pattern.
|
|
|
MicrosoftLearning/eShopOnWeb
Repository maintained by AZ-400 course and Learn content community. Project used for AZ-400 Labs. Forked from: https://github.com/dotnet-architecture/eShopOnWeb Sample - ASP.NET Core 8.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model.
|
|
|
SSWConsulting/SSW.CleanArchitecture
SSW Clean Architecture Template
|
|
|
ardalis/Ardalis.SharedKernel
Some useful base classes, mainly used with the CleanArchitecture template. Also, a template to make your own SharedKernel nuget package.
|
|
|
DevBetterCom/DevBetterWeb
A simple web application for devBetter
|
|
|
aehyok/.NET8.0
net8.0 efcore mysql redis rabbitmq 微服务
|
|
|
ardalis/HttpClientTestExtensions
Extensions for testing HTTP endpoints and deserializing the results. Currently works with XUnit.
|
|
|
baotoq/micro-commerce
.NET 10 .NET Aspire
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0 | 9 | 11/24/2026 |
| 9.3.1 | 4,555,476 | 8/24/2025 |
| 9.3.0 | 137,541 | 8/20/2025 |
| 9.2.0 | 1,060,421 | 6/8/2025 |
| 9.1.0 | 665,767 | 4/23/2025 |
| 9.0.1 | 384,235 | 3/14/2025 |
| 9.0.0 | 122,525 | 3/13/2025 |
| 8.0.0 | 7,475,675 | 11/22/2023 |
| 7.0.0 | 1,824,051 | 5/26/2023 |
| 6.1.0 | 2,808,467 | 6/24/2022 |
| 6.0.1 | 997,267 | 1/19/2022 |
| 6.0.0 | 62,529 | 1/18/2022 |
| 5.2.0 | 589,336 | 9/7/2021 |
| 5.1.0 | 296,006 | 4/17/2021 |
| 5.0.3 | 61,570 | 3/5/2021 |
| 5.0.2-beta | 1,954 | 3/4/2021 |
| 5.0.1-beta | 2,900 | 3/1/2021 |
| 5.0.0-beta | 2,851 | 3/1/2021 |
| 4.2.0 | 254,645 | 1/29/2021 |
Version 10.0.0 - the last MIT-licensed release. Future releases will require a (potentially free) commercial license: https://nimbletools.io/news/ardalis-nuget-packages/
* Targets net10.0, net11.0 and netstandard2.0 (Ardalis.Specification), net10.0 and net11.0 (EntityFrameworkCore), net10.0, net11.0 and net472 (EntityFramework6)
* Breaking: dropped net8.0 and net9.0 targets; EntityFrameworkCore package now requires EF Core 10 or 11
* Updated all NuGet dependencies
* NuGet package now ships its own focused readme
Full change log: https://github.com/ardalis/Specification/releases