Shuttle.Specification 21.0.1

Prefix Reserved
dotnet add package Shuttle.Specification --version 21.0.1
                    
NuGet\Install-Package Shuttle.Specification -Version 21.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="Shuttle.Specification" Version="21.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shuttle.Specification" Version="21.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Shuttle.Specification" />
                    
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 Shuttle.Specification --version 21.0.1
                    
#r "nuget: Shuttle.Specification, 21.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 Shuttle.Specification@21.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=Shuttle.Specification&version=21.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Shuttle.Specification&version=21.0.1
                    
Install as a Cake Tool

Shuttle.Core.Specification

Provides a simple implementation of the specification pattern.

Installation

dotnet add package Shuttle.Core.Specification

Synchronous Specification

ISpecification<T>

A custom specification can be implemented by inheriting from the ISpecification<T> interface:

public class MySpecification : ISpecification<MyCandidate>
{
    public bool IsSatisfiedBy(MyCandidate candidate)
    {
        return candidate.IsActive && !candidate.IsDeleted;
    }
}

Specification<T>

A default Specification<T> wrapper class is available that accepts a function as a callback for simple scenarios where an explicit ISpecification<T> implementation may not be warranted:

var specification = new Specification<MyCandidate>(candidate => candidate.IsActive && !candidate.IsDeleted);

if (specification.IsSatisfiedBy(myCandidate))
{
    // ...
}

Asynchronous Specification

IAsyncSpecification<T>

An asynchronous specification can be implemented by inheriting from the IAsyncSpecification<T> interface:

public class MyAsyncSpecification : IAsyncSpecification<MyCandidate>
{
    public async Task<bool> IsSatisfiedByAsync(MyCandidate candidate)
    {
        return await _myService.IsActiveAsync(candidate.Id);
    }
}

AsyncSpecification<T>

A default AsyncSpecification<T> wrapper class is available that accepts a function as a callback for simple scenarios where an explicit IAsyncSpecification<T> implementation may not be warranted:

var specification = new AsyncSpecification<MyCandidate>(async candidate => await _myService.IsActiveAsync(candidate.Id));

if (await specification.IsSatisfiedByAsync(myCandidate))
{
    // ...
}
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 (3)

Showing the top 3 NuGet packages that depend on Shuttle.Specification:

Package Downloads
Shuttle.Recall

Event sourcing mechanism.

Shuttle.Hopper

Hopper is a flexible enterprise service bus which works with Azure Storage Queues, Amazon SQS, RabbitMQ, Kafka, and Event Hubs through a provider plugin API.

Shuttle.Cron

Cron expression parsing.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
21.0.1 192 4/15/2026
21.0.1-rc3 219 4/11/2026