IronAlpine.Kernel
0.2.3
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
<PackageReference Include="IronAlpine.Kernel" Version="0.2.3" />
<PackageVersion Include="IronAlpine.Kernel" Version="0.2.3" />
<PackageReference Include="IronAlpine.Kernel" />
paket add IronAlpine.Kernel --version 0.2.3
#r "nuget: IronAlpine.Kernel, 0.2.3"
#:package IronAlpine.Kernel@0.2.3
#addin nuget:?package=IronAlpine.Kernel&version=0.2.3
#tool nuget:?package=IronAlpine.Kernel&version=0.2.3
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.0net10.0
What Is Included
Result/Result<T>andErrorValidationErrorandErrorTypeEntity<TId>andEntity(Guid specialization)ProjectionEntity<TId>andProjectionEntityIDomainEvent/DomainEventValueObjectEnumeration<TEnum>Specification<T>and evaluator helpersPagedResult<T>andPagedRequest- Base exception hierarchy (
BaseException,DomainException,ApplicationException,InfrastructureException,PersistenceException) StronglyTypedId<TValue>IClockandSystemClock
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)orResult.Failure(...))
Avoid serializing Result<T> wrapper instances directly.
License
MIT
| Product | Versions 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. |
-
net10.0
- IronAlpine.Mediator.Abstractions (>= 0.2.1)
-
net9.0
- IronAlpine.Mediator.Abstractions (>= 0.2.1)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on IronAlpine.Kernel:
| Package | Downloads |
|---|---|
|
IronAlpine.Data.EFCore
Entity Framework Core implementation for IronAlpine data abstractions with repositories, interceptors, enumeration mapping, and resilience integration. |
|
|
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.Validation.Fluent
FluentValidation integration for IronAlpine mediator pipelines with validator discovery, request validation wrappers, and deterministic Result or exception handling. |
|
|
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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Patch release: hardened Enumeration initialization with lazy guarded cache and improved runtime diagnostics.