DDD.Core.Components 1.0.4

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

Domain Driven Design Core Helpers

Domain Driven Design Core Helpers is a lightweight helper library for implementing Domain-Driven Design (DDD) in .NET applications.
It provides abstract base classes for common building blocks such as Value Objects and Entities, along with a simple Result type to standardize success/failure handling.


✨ Features

  • 🔹 Abstract Entity base class with identity handling.
  • 🔹 Abstract ValueObject base class with equality and immutability support.
  • 🔹 Result class for clean success/failure operations without exceptions.
  • 🔹 Designed for .NET 9.0+ and modern C#.

✨ Result Types

The package introduces different Results to represent the outcome of operations, allowing for clear handling of success, failure, and error propagation. Results are designed to be hierarchically convertible, meaning lower-level results can be implicitly converted into higher-level results while preserving their data.

There are two main categories of results:

  • Non-typed results: These contain general information about the operation, including:

    • Success status
    • Failure types (if any)
    • Error messages
    • The layer in which the failure occurred (e.g., Service layer)
  • Typed results: These inherit all functionality from non-typed results, in addition to:

    • the result's output type
    • The result's output (will throw error if the result is a failure)

Hierarchical Conversion

Results can be converted up the hierarchy. For instance, an EntityResult can be implicitly converted to a ServiceResult. This conversion retains all original values, and if the target result type is associated with a specific layer, the conversion will automatically assign the layer information.

Result Hierarchy

From lowest to highest in the hierarchy:

  • 🔹 ValueObjectResult: Used for creating value objects.
  • 🔹 EntityResult: Used within entity classes for domain-specific operations. The typed version only returns an Entity object.
  • 🔹 MapperResult: Used for object mapping operations.
  • 🔹 InfraResult: Used in the infrastructure layer for non-repository operations.
  • 🔹 RepoResult: Used in the infrastructure layer for repository operations. Can only contain an AggregateRoot.
  • 🔹 ServiceResult: Used in the service layer for domain-specific applications.
  • 🔹 UseCaseResult: Used in the use case layer. Typically, results are converted to this type when propagating outward.
  • 🔹 Result: A generic result type that can be used anywhere in the application.

📦 Installation

dotnet add package DDD.Core.Components
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.
  • net9.0

    • No dependencies.

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
1.0.4 135 8/30/2025
1.0.3 154 8/29/2025
1.0.2 164 8/27/2025
1.0.1 74 8/24/2025
1.0.0 73 8/24/2025