IronAlpine.Kernel 0.2.3

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package IronAlpine.Kernel --version 0.2.3
                    
NuGet\Install-Package IronAlpine.Kernel -Version 0.2.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="IronAlpine.Kernel" Version="0.2.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IronAlpine.Kernel" Version="0.2.3" />
                    
Directory.Packages.props
<PackageReference Include="IronAlpine.Kernel" />
                    
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 IronAlpine.Kernel --version 0.2.3
                    
#r "nuget: IronAlpine.Kernel, 0.2.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 IronAlpine.Kernel@0.2.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=IronAlpine.Kernel&version=0.2.3
                    
Install as a Cake Addin
#tool nuget:?package=IronAlpine.Kernel&version=0.2.3
                    
Install as a Cake Tool

IronAlpine.Kernel

IronAlpine.Kernel provides reusable domain and application primitives for .NET microservices and modular systems.

Install

dotnet add package IronAlpine.Kernel

Target Frameworks

  • net9.0
  • net10.0

What Is Included

  • Result / Result<T> and Error
  • ValidationError and ErrorType
  • Entity<TId> and Entity (Guid specialization)
  • ProjectionEntity<TId> and ProjectionEntity
  • IDomainEvent / DomainEvent
  • ValueObject
  • Enumeration<TEnum>
  • Specification<T> and evaluator helpers
  • PagedResult<T> and PagedRequest
  • Base exception hierarchy (BaseException, DomainException, ApplicationException, InfrastructureException, PersistenceException)
  • StronglyTypedId<TValue>
  • IClock and SystemClock

Result Pattern

using IronAlpine.Kernel.Results;

public static Result<int> Divide(int left, int right)
{
    if (right == 0)
    {
        return Result.Failure<int>(
            Error.Validation(
                code: "Math.DivideByZero",
                message: "Right operand cannot be zero.",
                validationErrors: [new ValidationError("right", "Must be non-zero")]
            ));
    }

    return Result.Success(left / right);
}

Result Conversions

Result<string> ok = "payload";      // implicit: payload -> Result<string>
Result<string> fail = (string?)null; // implicit: null -> Failure(Error.NullValue)

var value = (string)ok; // explicit: Result<string> -> string (throws on failure)

ValueObject

using IronAlpine.Kernel.Primitives;

public sealed class Money : ValueObject
{
    public decimal Amount { get; }
    public string Currency { get; }

    public Money(decimal amount, string currency)
    {
        Amount = amount;
        Currency = currency;
    }

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

Enumeration

using IronAlpine.Kernel.Primitives;

public sealed class UserStatus : Enumeration<UserStatus>
{
    public static readonly UserStatus Active = new(1, "Active");
    public static readonly UserStatus Passive = new(2, "Passive");

    private UserStatus(int id, string name) : base(id, name) { }
}

var strict = UserStatus.FromValue(1);               // throws if not found
var softById = UserStatus.FromValueOrDefault(999);  // null if not found
var softByName = UserStatus.FromNameOrDefault("x");

Exceptions

using IronAlpine.Kernel.Exceptions;

throw new DomainException(
    message: "Business rule violated.",
    code: "Domain.RuleViolation");

Important Serialization Note

Result and Result<T> are not designed as a JSON roundtrip contract.

Recommended approach:

  • serialize the payload (T) to cache/message
  • recreate wrapper on read (Result.Success(payload) or Result.Failure(...))

Avoid serializing Result<T> wrapper instances directly.

License

MIT

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

Showing the top 5 NuGet packages that depend on IronAlpine.Kernel:

Package Downloads
IronAlpine.Data.Abstractions

Data contracts for aggregate and projection repositories, unit of work, paging, and query primitives.

IronAlpine.Messaging.Abstractions

Transport-agnostic messaging contracts for integration events, event registry, envelopes, headers, and producer-consumer-event bus interactions in distributed .NET services.

IronAlpine.Data.EFCore

Entity Framework Core implementation for IronAlpine data abstractions with repositories, interceptors, enumeration mapping, and resilience integration.

IronAlpine.Messaging.InboxOutbox.EFCore

EF Core inbox-outbox implementation for integration events with claim-based processing, retries, database dead-letter persistence, and hosted worker services.

IronAlpine.Messaging.InboxOutbox.Dapper

Dapper inbox-outbox implementation for integration events with claim-based processing, retries, database dead-letter persistence, and hosted worker services.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-rc8 33 3/10/2026
1.0.0-rc4 65 3/10/2026
1.0.0-rc1 106 3/9/2026
0.2.3 447 3/2/2026
0.2.2 175 3/2/2026
0.2.1 89 2/27/2026
0.2.0 82 2/27/2026

Patch release: hardened Enumeration initialization with lazy guarded cache and improved runtime diagnostics.