Aspireng.Domain 1.1.3

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

Aspireng.Domain

Purpose: Pure domain building blocks that remain stable across microservices:

  • Base entity contract (BaseEntity)
  • Repository abstraction (IRepository<T>)
  • Specification pattern (ISpecification<T>, SortDescriptor<T>)

No infrastructure or framework dependencies. Keep this package small, stable, and free of runtime side-effects.


Contents

  • Entities/BaseEntity.cs – common entity Id + optional concurrency token.
  • Abstractions/IRepository.cs – storage-agnostic repository contract.
  • Abstractions/ISpecification.cs – composable, provider-friendly query description.
  • Abstractions/SortDescriptor.cs – ordering rules for specifications.

Design Guidelines

  • DDD location: Repository abstractions live in the domain layer; concrete implementations live in Infrastructure.
  • Expressions only: ISpecification<T>.Criteria is an Expression<Func<T,bool>> to allow EF translation or in-memory evaluation.
  • No ad-hoc SQL: Avoid string queries; introduce named specifications instead.
  • Portability: BaseEntity.Id is string to play nicely with files, SQL, memory, etc.

Example

using System.Linq.Expressions;
using Aspireng.Domain.Abstractions;
using Aspireng.Domain.Entities;

public sealed class CreatedTodaySpec<T> : ISpecification<T> where T : BaseEntity, IHasCreatedAt
{
    public Expression<Func<T, bool>>? Criteria { get; } =
        x => x.CreatedAt.Date == DateTimeOffset.UtcNow.Date;

    public IReadOnlyList<SortDescriptor<T>> OrderBy { get; } =
        new[] { new SortDescriptor<T>(x => x.CreatedAt, ascending: false) };

    public int? Skip { get; } = null;
    public int? Take { get; } = 100;
}

What not to put here

  • No EF Core types, DbContexts, file IO, HTTP, caching, logging, or DI.
  • No microservice-specific domain entities. Each service owns its domain models.

Versioning

  • Semantic Versioning (SemVer). Avoid breaking the repository/specification surface.
  • Add capabilities via new interfaces or extension methods when possible.

Pack

./build/release-aspireng.cmd

The package id should be Aspireng.Domain.

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 (2)

Showing the top 2 NuGet packages that depend on Aspireng.Domain:

Package Downloads
Aspireng.Application

Application for repositories and specs.

Aspireng.Infrastructure

Infrastructure for repositories and specs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.3 70 8/22/2025
1.1.2 64 8/22/2025
1.1.1 69 8/22/2025
1.0.9 64 8/22/2025
1.0.7 79 8/22/2025
1.0.6 126 8/21/2025
1.0.5 127 8/20/2025
1.0.4 129 8/20/2025
1.0.2 125 8/20/2025
1.0.1 124 8/20/2025
1.0.0 133 8/20/2025