Tolitech.Domain.Specifications 1.0.0-preview.7

This is a prerelease version of Tolitech.Domain.Specifications.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Tolitech.Domain.Specifications --version 1.0.0-preview.7
                    
NuGet\Install-Package Tolitech.Domain.Specifications -Version 1.0.0-preview.7
                    
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="Tolitech.Domain.Specifications" Version="1.0.0-preview.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tolitech.Domain.Specifications" Version="1.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="Tolitech.Domain.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 Tolitech.Domain.Specifications --version 1.0.0-preview.7
                    
#r "nuget: Tolitech.Domain.Specifications, 1.0.0-preview.7"
                    
#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 Tolitech.Domain.Specifications@1.0.0-preview.7
                    
#: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=Tolitech.Domain.Specifications&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Tolitech.Domain.Specifications&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Tool

Tolitech.Domain.Specifications

Overview

Tolitech.Domain.Specifications implements the Specification pattern for .NET, enabling reusable, composable business rules and queries. It extends repository interfaces to support specification-based filtering and projections.

Features

  • Specification Pattern: Encapsulate business rules and queries as specifications.
  • Repository Extensions: Query entities using specifications and projections.
  • Async Operations: All repository methods are asynchronous.

Installation

Add a reference to the Tolitech.Domain.Specifications project or install via NuGet:

 dotnet add package Tolitech.Domain.Specifications

Usage

Specification Example

public class LegalAgeSpecification : Specification<Person>
{
    public override Expression<Func<Person, bool>> ToExpression() => p => p.Age >= 18;
}

Repository Query Example

var spec = new LegalAgeSpecification();
List<Person> adults = await repository.ToListAsync(spec, CancellationToken.None);

Projection Example

var spec = new LegalAgeSpecification();
List<string> names = await repository.ToListAsync(spec, p => p.Name, CancellationToken.None);

Count & Existence

bool anyAdults = await repository.AnyAsync(spec, CancellationToken.None);
int count = await repository.CountAsync(spec, CancellationToken.None);

Notes

  • Specifications can be combined for complex queries.
  • Integrates seamlessly with Tolitech.Domain entities and repositories.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

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