# ardalis/Specification

Base class with tests for adding specifications to a DDD model

Repository: https://github.com/ardalis/Specification
Canonical: https://ross.abutalabs.com/products/specification
Language: C#
License: MIT
License Family: permissive
Topics: ddd, design-patterns, domain-driven-design, dotnet, repository-pattern, specification-pattern, hacktoberfest
Last push: 2025-11-25T20:48:35+00:00

## Health v2 (maintenance only)
Score: 56/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 54, release rhythm 32, longevity 100
- inputs: {"age_days": 3123, "days_push": 281, "days_rel": 374, "gap_med": 39, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2276, forks 262 (observed 2026-08-28T04:06:33.425727+00:00)

## What it is
A .NET library implementing the Specification pattern for building reusable, composable query specifications, commonly used with EF Core and the repository pattern in domain-driven design. It centralizes query logic like filtering, includes, and paging into specification classes instead of scattering Where/Include expressions across the codebase.

## Use cases
- encapsulate EF Core query logic in reusable specification classes
- reduce boilerplate repository methods in a DDD application
- build composable filters, includes, and paging for queries
- implement the repository pattern with a single generic ListAsync method
- clean up scattered Where and Include expressions in ASP.NET Core apps

## When to choose
- you use EF Core with a repository or Clean Architecture style design
- you want query logic centralized and testable via the specification pattern
- you follow domain-driven design in .NET

## When to avoid
- you use a non-.NET stack or an ORM other than EF Core without an adapter
- your queries are trivial and direct LINQ is sufficient
- you prefer micro-ORMs or raw SQL over repository abstractions

## Facets
- artifact type: library
- maturity: stable
- function: orm, database, middleware
- domain: backend, web-development, developer-tools
- platform: dotnet, cross-platform
- tags: specification-pattern, domain-driven-design, repository-pattern, ef-core, ddd, query-builder

## Member repositories
- ardalis/Specification (main) score 56

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:33.425727+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:41:27.262224+00:00, confidence not recorded.
  - readme: https://github.com/ardalis/Specification (fetched 2026-08-28T04:06:33.425727+00:00, sha e6d0aab0d0d4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
