Table of Contents

Class OperationReason

Namespace
AsiBackbone.Core.Results
Assembly
AsiBackbone.Core.dll

Represents a machine-readable reason associated with an operation result.

public sealed class OperationReason
Inheritance
OperationReason
Inherited Members

Constructors

OperationReason(string, string)

Initializes a new instance of the OperationReason class.

public OperationReason(string code, string message)

Parameters

code string

The machine-readable reason code.

message string

The human-readable reason message.

OperationReason(string, string, IReadOnlyDictionary<string, string>?)

Initializes a new instance of the OperationReason class.

public OperationReason(string code, string message, IReadOnlyDictionary<string, string>? metadata)

Parameters

code string

The machine-readable reason code.

message string

The human-readable reason message.

metadata IReadOnlyDictionary<string, string>

Optional metadata associated with the reason.

Properties

Code

Gets the machine-readable reason code.

public string Code { get; }

Property Value

string

HasMetadata

Gets a value indicating whether this reason has metadata.

public bool HasMetadata { get; }

Property Value

bool

Message

Gets the human-readable reason message.

public string Message { get; }

Property Value

string

Metadata

Gets optional metadata associated with the reason.

public IReadOnlyDictionary<string, string> Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>

Methods

Create(string, string)

Creates an operation reason.

public static OperationReason Create(string code, string message)

Parameters

code string

The machine-readable reason code.

message string

The human-readable reason message.

Returns

OperationReason

An operation reason.

Create(string, string, IReadOnlyDictionary<string, string>)

Creates an operation reason with metadata.

public static OperationReason Create(string code, string message, IReadOnlyDictionary<string, string> metadata)

Parameters

code string

The machine-readable reason code.

message string

The human-readable reason message.

metadata IReadOnlyDictionary<string, string>

Optional metadata associated with the reason.

Returns

OperationReason

An operation reason.