ImanSoftware.Domain 1.0.6

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

ImanSoftware.Domain

Version: 1.0.0 | Last Updated: August 2026

A lightweight foundation for building Domain-Driven Design (DDD) applications in .NET.

ImanSoftware.Domain provides the essential building blocks required to implement a clean and maintainable domain layer. It includes base entities, value objects, aggregate roots, specifications, repositories, domain events, and common domain models while remaining infrastructure-independent.


Installation

Install the package using the .NET CLI:

dotnet add package ImanSoftware.Domain

Why ImanSoftware.Domain?

Building a rich domain model often requires the same foundational components across projects.

This package provides reusable abstractions so you can focus on your business rules instead of rewriting infrastructure-independent domain code.

Benefits include:

  • Clean Domain-Driven Design foundation
  • Infrastructure-independent architecture
  • Reusable domain building blocks
  • Consistent modeling across projects
  • Lightweight and dependency-free

Features

  • BaseEntity<TId>
  • AggregateRoot<TId>
  • ValueObject
  • ✅ Domain Events
  • ✅ Guard Clauses
  • ✅ Repository Interfaces
  • ✅ Unit of Work Interface
  • ✅ Specification Pattern
  • ✅ Common Domain Value Objects
  • ✅ Pagination Model

BaseEntity<TId>

Base class for all entities.

Features:

  • Entity identity
  • Equality support
  • Hash code implementation

Example:

public class Product : BaseEntity<Guid>
{
    public Product(Guid id) : base(id)
    {
    }
}

AggregateRoot<TId>

Base class for aggregate roots.

Features:

  • Domain event support
  • Entity identity
  • Aggregate behavior

Example:

public class Order : AggregateRoot<Guid>
{
    // Domain logic
}

ValueObject

Simplifies creating immutable value objects with value-based equality.

Example:

public class Money : ValueObject
{
    public decimal Amount { get; }

    public string Currency { get; }

    protected override IEnumerable<object> GetEqualityComponents()
    {
        yield return Amount;
        yield return Currency;
    }
}

Guard Clauses

Validate input values using expressive guard methods.

Available methods:

  • AgainstNull()
  • AgainstNullOrWhiteSpace()
  • AgainstOutOfRange()

Example:

Name = Guard.AgainstNullOrWhiteSpace(name, nameof(name));

Price = Guard.AgainstNull(price, nameof(price));

Repository Abstractions

Infrastructure-independent repository interfaces.

Available interfaces:

  • IRepository<T>
  • IReadOnlyRepository<T>
  • IUnitOfWork

These interfaces allow your domain layer to remain completely independent from persistence technologies.


Specification Pattern

Supports reusable business queries using the Specification Pattern.

Available types:

  • ISpecification<T>
  • BaseSpecification<T>

Example:

public class ActiveProductsSpecification
    : BaseSpecification<Product>
{
    public ActiveProductsSpecification()
    {
        Criteria = x => x.IsActive;
    }
}

Built-in Domain Models

The package includes several reusable domain models:

  • EmailAddress
  • PhoneNumber
  • Money
  • Address
  • DateRange
  • PagedResult<T>

These models encapsulate common business concepts and promote consistency throughout your domain.


Domain Events

Built-in support for domain events.

Available types:

  • IDomainEvent
  • DomainEventBase
  • IEventHandler<T>

Example:

public class ProductCreatedEvent : DomainEventBase
{
    public Guid ProductId { get; }

    public ProductCreatedEvent(Guid productId)
    {
        ProductId = productId;
    }
}

Complete Example

using ImanSoftware.Domain;

public class Product : BaseEntity<Guid>
{
    public string Name { get; private set; }

    public Money Price { get; private set; }

    public Product(Guid id, string name, Money price)
        : base(id)
    {
        Name = Guard.AgainstNullOrWhiteSpace(name, nameof(name));

        Price = Guard.AgainstNull(price, nameof(price));
    }
}

Design Goals

  • Domain-Driven Design first
  • Infrastructure independent
  • Clean Architecture friendly
  • High performance
  • Lightweight
  • Minimal dependencies
  • Reusable domain abstractions
  • Rich domain modeling
  • Easy to extend

Requirements

  • .NET Standard 2.0+
  • .NET 6+
  • .NET 7+
  • .NET 8+
  • .NET 9+
  • .NET 10.0+

Author

Iman Estiri

📧 contact.imanestiri@gmail.com

📧 dev.imanestiri@gmail.com

GitHub:

https://github.com/ImanEstiri


License

This project is licensed under the MIT License.

Product 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ImanSoftware.Domain:

Package Downloads
ImanSoftware.Framework

Umbrella package that bundles all ImanSoftware modules for a unified development experience.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6 122 8/29/2026
1.0.5 89 8/29/2026
1.0.4 93 8/29/2026
1.0.3 101 8/29/2026
1.0.2 125 8/5/2026
1.0.1 109 8/3/2026
1.0.0 114 8/2/2026