Sparkdo.Specifications
2.0.0-preview.1
This is a prerelease version of Sparkdo.Specifications.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sparkdo.Specifications --version 2.0.0-preview.1
NuGet\Install-Package Sparkdo.Specifications -Version 2.0.0-preview.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="Sparkdo.Specifications" Version="2.0.0-preview.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Specifications" Version="2.0.0-preview.1" />
<PackageReference Include="Sparkdo.Specifications" />
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 Sparkdo.Specifications --version 2.0.0-preview.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sparkdo.Specifications, 2.0.0-preview.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 Sparkdo.Specifications@2.0.0-preview.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=Sparkdo.Specifications&version=2.0.0-preview.1&prerelease
#tool nuget:?package=Sparkdo.Specifications&version=2.0.0-preview.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.Specifications
Sparkdo.Specifications 提供 BCL-only 的领域规则表达与组合能力。
创建和组合
using Sparkdo.Specifications;
var adult = Specification.Named<Person>("Adult", person => person.Age >= 18);
var active = Specification.From<Person>(person => person.IsActive);
var activeAdult = adult.And(active);
activeAdult.IsSatisfiedBy(person);
query.Where(activeAdult);
Specification.PropertyEquals 与 Specification.PropertySatisfies 可从属性 selector 创建规则;AllOf、AnyOf 和 NoneOf 可批量组合规则;AndIf 与 OrIf 用于条件组合。
如需自定义实现,可直接实现 ISpecification<T>,或继承 Specification<T> 复用解释执行 predicate。组合结果公开 Left、Right 或 Inner,便于审计规则结构。
包边界
该包不依赖 Sparkdo Runtime、Hosting、EF Core、ASP.NET Core、Repository、UOW 或 Data,也不负责 provider 翻译、分页、排序、Include 或 tracking。
验证
dotnet restore src/specifications/Sparkdo.Specifications.slnx
dotnet build src/specifications/Sparkdo.Specifications.slnx --no-restore -p:UseSharedCompilation=false -nr:false
dotnet test src/specifications/Sparkdo.Specifications.slnx --filter "Gate!=PackageAsset" --no-restore -p:UseSharedCompilation=false -nr:false
dotnet pack src/specifications/Sparkdo.Specifications.slnx -c Release -p:UseSharedCompilation=false -nr:false
dotnet test src/specifications/Sparkdo.Specifications.slnx --filter "Gate=PackageAsset" --no-restore -p:UseSharedCompilation=false -nr:false
| Product | Versions 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.
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Sparkdo.Specifications:
| Package | Downloads |
|---|---|
|
Sparkdo.Ddd.Domain
Sparkdo DDD 领域模型库,提供领域驱动设计的核心组件实现 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.2 | 43 | 7/20/2026 |
| 2.0.0-preview.1 | 46 | 7/18/2026 |
| 1.0.4-preview.3 | 175 | 6/8/2026 |
| 1.0.4-preview.2 | 164 | 6/7/2026 |
| 1.0.4-preview.1 | 173 | 6/7/2026 |
| 1.0.3 | 375 | 6/6/2026 |
| 1.0.3-preview.1 | 167 | 5/17/2026 |
| 1.0.2 | 320 | 4/27/2026 |
| 1.0.2-preview.5 | 101 | 4/15/2026 |
| 1.0.2-preview.4 | 113 | 2/8/2026 |
| 1.0.2-preview.3 | 118 | 2/1/2026 |
| 1.0.2-preview.2 | 127 | 1/31/2026 |
| 1.0.2-preview.1 | 196 | 12/4/2025 |
| 1.0.1 | 821 | 11/27/2025 |
| 1.0.0 | 775 | 11/25/2025 |
| 1.0.0-preview.5 | 150 | 10/24/2025 |