specification-pattern

Community

Composable EF Core queries with specs.

Authorronnythedev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The Specification pattern encapsulates query logic into reusable, composable, and testable building blocks for EF Core, centralizing criteria, includes, ordering, and paging.

Core Features & Use Cases

  • Reusable criteria: define and reuse filters across repositories.
  • Includes and paging: specify eager loading and page-sized results consistently.
  • Order by support: apply deterministic sorting for stable results.
  • Use Case: fetch a paged list of active entities for a given organization with optional includes.

Quick Start

Create a concrete specification by extending BaseSpecification<T>, add criteria via AddCriteria, attach includes with AddInclude, and apply paging with ApplyPaging. Then pass the specification to a repository that uses SpecificationEvaluator to execute the query.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: specification-pattern
Download link: https://github.com/ronnythedev/dotnet-clean-architecture-skills/archive/main.zip#specification-pattern

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.