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
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
codestringThe machine-readable reason code.
messagestringThe human-readable reason message.
metadataIReadOnlyDictionary<string, string>Optional metadata associated with the reason.
Properties
Code
Gets the machine-readable reason code.
public string Code { get; }
Property Value
HasMetadata
Gets a value indicating whether this reason has metadata.
public bool HasMetadata { get; }
Property Value
Message
Gets the human-readable reason message.
public string Message { get; }
Property Value
Metadata
Gets optional metadata associated with the reason.
public IReadOnlyDictionary<string, string> Metadata { get; }
Property Value
Methods
Create(string, string)
Creates an operation reason.
public static OperationReason Create(string code, string message)
Parameters
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
codestringThe machine-readable reason code.
messagestringThe human-readable reason message.
metadataIReadOnlyDictionary<string, string>Optional metadata associated with the reason.
Returns
- OperationReason
An operation reason.