Class MessageDetail
- Namespace
- NuvTools.Common.ResultWrapper
- Assembly
- NuvTools.Common.dll
Represents a detailed message related to an operation result, such as informational, success, warning, or error messages.
public record MessageDetail : IEquatable<MessageDetail>
- Inheritance
-
MessageDetail
- Implements
- Inherited Members
- Extension Methods
Examples
Example usage:
var message = new MessageDetail(
Title: "Validation failed",
Detail: "The email address format is invalid.",
Code: "VAL001",
Severity: Severity.Warning
);
Remarks
The MessageDetail record is typically used as part of a Result or Result<T> object to provide structured feedback about an operation. It allows developers to capture human-readable messages along with metadata such as message code and severity.
Constructors
MessageDetail(string, string?, string?, Severity?)
Represents a detailed message related to an operation result, such as informational, success, warning, or error messages.
public MessageDetail(string Title, string? Detail = null, string? Code = null, Severity? Severity = null)
Parameters
TitlestringThe short, human-readable message summarizing the event or result.
DetailstringAn optional detailed description that provides more context or technical information about the message.
CodestringAn optional identifier that uniquely represents the message type or category, useful for localization, logging, or client-side handling.
SeveritySeverity?The severity level of the message (e.g., Information, Warning, Error).
Examples
Example usage:
var message = new MessageDetail(
Title: "Validation failed",
Detail: "The email address format is invalid.",
Code: "VAL001",
Severity: Severity.Warning
);
Remarks
The MessageDetail record is typically used as part of a Result or Result<T> object to provide structured feedback about an operation. It allows developers to capture human-readable messages along with metadata such as message code and severity.
Properties
Code
An optional identifier that uniquely represents the message type or category, useful for localization, logging, or client-side handling.
public string? Code { get; init; }
Property Value
Detail
An optional detailed description that provides more context or technical information about the message.
public string? Detail { get; init; }
Property Value
Severity
The severity level of the message (e.g., Information, Warning, Error).
public Severity? Severity { get; init; }
Property Value
Title
The short, human-readable message summarizing the event or result.
public string Title { get; init; }