Table of Contents

Interface IResult

Namespace
NuvTools.Common.ResultWrapper
Assembly
NuvTools.Common.dll

Defines the base contract for an operation result, representing the outcome of a business or system process along with contextual messages.

public interface IResult
Extension Methods

Examples

Example usage:

IResult result = Result.Success("Operation completed successfully.");

if (!result.Succeeded)
{
    logger.LogError(result.Message);
}

Remarks

This interface provides a consistent structure for handling success and error results throughout the application.
Implementations usually include information such as:

  • Whether the operation succeeded (Succeeded)
  • The result classification (ResultType)
  • Messages providing feedback or error details (Messages)

It is commonly implemented by Result and Result<T> classes.

Properties

ContainsNotFound

Indicates whether the result represents a "Not Found" condition. Useful for distinguishing between empty results and missing resources.

bool ContainsNotFound { get; }

Property Value

bool

Message

A simplified or aggregated version of the main message, typically derived from Title.

string? Message { get; }

Property Value

string

MessageDetail

The primary message detail, typically the first or most relevant message from the Messages collection.

MessageDetail? MessageDetail { get; }

Property Value

MessageDetail

Messages

A collection of messages associated with the operation result. Each MessageDetail contains structured information about the outcome (e.g., warnings, validation errors, or success messages).

List<MessageDetail> Messages { get; }

Property Value

List<MessageDetail>

ResultType

Specifies the type or classification of the result, such as Success, Error, or ValidationError.

ResultType ResultType { get; }

Property Value

ResultType

Succeeded

Indicates whether the operation completed successfully.

bool Succeeded { get; }

Property Value

bool