ImanSoftware.Domain
1.0.6
dotnet add package ImanSoftware.Domain --version 1.0.6
NuGet\Install-Package ImanSoftware.Domain -Version 1.0.6
<PackageReference Include="ImanSoftware.Domain" Version="1.0.6" />
<PackageVersion Include="ImanSoftware.Domain" Version="1.0.6" />
<PackageReference Include="ImanSoftware.Domain" />
paket add ImanSoftware.Domain --version 1.0.6
#r "nuget: ImanSoftware.Domain, 1.0.6"
#:package ImanSoftware.Domain@1.0.6
#addin nuget:?package=ImanSoftware.Domain&version=1.0.6
#tool nuget:?package=ImanSoftware.Domain&version=1.0.6
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:
EmailAddressPhoneNumberMoneyAddressDateRangePagedResult<T>
These models encapsulate common business concepts and promote consistency throughout your domain.
Domain Events
Built-in support for domain events.
Available types:
IDomainEventDomainEventBaseIEventHandler<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:
License
This project is licensed under the MIT License.
| 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. |
-
net10.0
- ImanSoftware.Outcome (>= 1.0.3)
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.