Mohd2sh.CleanArchitecture.Core.Domain 1.0.0

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

CleanArchitecture.Core.Domain

Core domain abstractions and base types for Clean Architecture applications following Domain-Driven Design principles.

Purpose

This package provides base classes and interfaces for building domain models in Clean Architecture applications. It includes abstractions for entities, value objects, aggregate roots, and domain events.

Installation

dotnet add package Mohd2sh.CleanArchitecture.Core.Domain

Usage

Entity

public class Product : Entity<Guid>
{
    public string Name { get; private set; }
    
    private Product() { }
    
    public Product(Guid id, string name)
    {
        Id = id;
        Name = name;
    }
}

Value Object

public record Money : ValueObject
{
    public decimal Amount { get; init; }
    public string Currency { get; init; }
    
    protected override IEnumerable<object?> GetAtomicValues()
    {
        yield return Amount;
        yield return Currency;
    }
}

Aggregate Root

public class Order : AggregateRoot<Guid>
{
    public string OrderNumber { get; private set; }
    
    private Order() { }
    
    public Order(Guid id, string orderNumber) : base(id)
    {
        OrderNumber = orderNumber;
    }
}

Domain Event

public sealed record OrderCreatedEvent(Guid OrderId) : IDomainEvent;

Key Components

  • Entity<TId> - Base class for domain entities
  • ValueObject - Base class for value objects
  • AggregateRoot<TId> - Base class for aggregate roots with optimistic concurrency
  • IDomainEvent - Interface for domain events
  • AuditableEntity<TId> - Base class with audit fields

Repository

GitHub: https://github.com/mohd2sh/CleanArchitecture-DDD-CQRS

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Mohd2sh.CleanArchitecture.Core.Domain:

Package Downloads
Mohd2sh.CleanArchitecture.Core.Application

Core application layer abstractions, CQRS interfaces, and handler registration extensions for Clean Architecture. Includes ICommand, IQuery, IMediator interfaces, event handlers, and DI extensions for automatic handler discovery and registration.

Mohd2sh.CleanArchitecture.Core.ArchitectureTests

Reusable architecture test base classes for Clean Architecture and DDD validation. Provides base test classes that consumers can inherit to enforce architectural rules and boundaries.

Mohd2sh.CleanArchitecture.Core.Infrastructure

Core infrastructure implementations including custom mediator, event dispatchers, and dependency injection extensions for Clean Architecture. Provides ready-to-use implementations of IMediator, IDomainEventDispatcher, IIntegrationEventDispatcher with DI registration extensions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 255 11/10/2025
1.0.0-alpha.6 141 11/10/2025
1.0.0-alpha.5 143 11/10/2025