Komair.Specifications 8.3.0

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

Komair.Specifications

A .NET implementation of the Specification pattern for building composable business rules.

Key Concepts

  • ISpecification<T> – abstraction for a predicate that can be combined and evaluated
  • And / Or with params – fold any number of specifications onto the receiver (e.g. mySpec.And(a, b) is equivalent to chaining mySpec.And(a).And(b); same idea for Or)
  • TrueSpecification<T>.Identity / FalseSpecification<T>.Identity – neutral elements for those folds: true for And, false for Or
  • combinatorsAnd, Or, and Not specifications for composing more complex rules
  • expression pipelineToExpression and Where expose Expression<Func<T, Boolean>> for use with LINQ providers

Starting from Identity

Use the always-true identity when you want “and together these specs” without an existing left-hand specification:

var spec = TrueSpecification<Order>.Identity.And(active, paid, notCancelled);

Use the always-false identity when you want “or together these specs” the same way:

var spec = FalseSpecification<Order>.Identity.Or(draft, archived, pendingReview);

With no extra arguments, TrueSpecification<T>.Identity.And() stays always true, and FalseSpecification<T>.Identity.Or() stays always false. You can still start from any other specification instead (e.g. active.And(paid, shipped)).

Typical Usage

Use specifications to encapsulate complex predicates, compose them fluently, and reuse them across repositories, query handlers, and validation layers.

Installation

dotnet add package Komair.Specifications
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.3.0 477 3/22/2026
8.2.1 89 3/20/2026
8.2.0 189 3/14/2026
8.1.0 102 3/12/2026
8.0.0 183 3/6/2026
6.0.0 675 4/12/2022
1.3.0 640 7/24/2021
1.2.0 532 5/17/2021
1.1.0 892 7/28/2020
1.0.1 691 7/17/2020
1.0.0 718 7/17/2020