Table of Contents

Class AssetId

Namespace
Tudormobile.IronLedgerLib
Assembly
Tudormobile.IronLedgerLib.dll

Represents an asset identifier that can use different identification types.

public record AssetId : IEquatable<AssetId>
Inheritance
AssetId
Implements
Inherited Members
Extension Methods

Constructors

AssetId()

public AssetId()

AssetId(AssetId)

Copy constructor invoked by with expressions. Intentionally excludes _idCache so that modified copies always compute a fresh identifier from their own metadata.

protected AssetId(AssetId original)

Parameters

original AssetId

The original instance to copy properties from.

Properties

BaseBoardMetadata

Gets the baseboard (motherboard) level metadata associated with this asset.

public required AssetMetadata BaseBoardMetadata { get; init; }

Property Value

AssetMetadata

BiosMetadata

Gets the bios level metadata associated with this asset.

public required AssetMetadata BiosMetadata { get; init; }

Property Value

AssetMetadata

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Id

Gets a unique identifier derived from the combined metadata. This ID is deterministic and suitable for use as a database key.

public string Id { get; }

Property Value

string

Remarks

The ID is generated using SHA256 hash of all metadata properties, ensuring consistency across multiple instantiations with the same data. The hash is computed lazily on first access and cached for subsequent calls. The cache is intentionally excluded from with expression copies so that modified instances always compute a fresh ID from their own metadata.

SystemMetadata

Gets the system level metadata associated with this asset.

public required AssetMetadata SystemMetadata { get; init; }

Property Value

AssetMetadata

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(AssetId?)

public virtual bool Equals(AssetId? other)

Parameters

other AssetId

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

IsValid(string?)

Determines whether the specified string is a valid asset identifier. A valid identifier is a 64-character lowercase hexadecimal string produced by a SHA-256 hash.

public static bool IsValid(string? id)

Parameters

id string

The string to validate.

Returns

bool

true if id is a valid asset identifier; otherwise, false.

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

Returns the unique identifier for this asset.

public override string ToString()

Returns

string

A 64-character hexadecimal string representing the unique identifier.

Operators

operator ==(AssetId?, AssetId?)

public static bool operator ==(AssetId? left, AssetId? right)

Parameters

left AssetId
right AssetId

Returns

bool

operator !=(AssetId?, AssetId?)

public static bool operator !=(AssetId? left, AssetId? right)

Parameters

left AssetId
right AssetId

Returns

bool