FileSurfer 2.1.2
Cross-platform file manager with support for Git and SFTP
Loading...
Searching...
No Matches
FileSurfer.Core.Models.Result Class Referencesealed

A flexible implementation of IResult that supports multiple error messages and can be updated after creation. More...

Inheritance diagram for FileSurfer.Core.Models.Result:
Collaboration diagram for FileSurfer.Core.Models.Result:

Public Member Functions

void AddError (string errorMessage)
 Appends an error message to this result.
Result MergeResult (IResult result)
 Appends all errors from another result to this result.

Static Public Member Functions

static Result Ok ()
 Creates a successful result with no errors.
static Result Error (string errorMessage)
 Creates a failed result with a single error message.
static Result Error (IEnumerable< string > errors)
 Creates a failed result with multiple error messages.
static Result Error (IResult result)
 Creates a failed result by copying errors from another result.

Properties

bool IsOk [get]
 Value indicating whether the operation was successful.
IEnumerable< string > Errors [get]
 Collection of error messages describing why the operation failed.

Detailed Description

A flexible implementation of IResult that supports multiple error messages and can be updated after creation.

Member Function Documentation

◆ AddError()

void FileSurfer.Core.Models.Result.AddError ( string errorMessage)
inline

Appends an error message to this result.

Parameters
errorMessageError message to add.

◆ Error() [1/3]

Result FileSurfer.Core.Models.Result.Error ( IEnumerable< string > errors)
inlinestatic

Creates a failed result with multiple error messages.

Parameters
errorsCollection of error messages describing the failure.
Returns
Failed Result containing all provided errors.

◆ Error() [2/3]

Result FileSurfer.Core.Models.Result.Error ( IResult result)
inlinestatic

Creates a failed result by copying errors from another result.

Parameters
resultSource result whose errors should be copied.
Returns
Failed Result containing errors from result .

◆ Error() [3/3]

Result FileSurfer.Core.Models.Result.Error ( string errorMessage)
inlinestatic

Creates a failed result with a single error message.

Parameters
errorMessageError message describing the failure.
Returns
Failed Result containing the provided error.
Here is the caller graph for this function:

◆ MergeResult()

Result FileSurfer.Core.Models.Result.MergeResult ( IResult result)
inline

Appends all errors from another result to this result.

Parameters
resultResult whose errors should be merged into this instance.
Returns
This Result instance after merging.
Here is the caller graph for this function:

◆ Ok()

Result FileSurfer.Core.Models.Result.Ok ( )
inlinestatic

Creates a successful result with no errors.

Returns
Successful Result instance.
Here is the caller graph for this function:

Property Documentation

◆ Errors

IEnumerable<string> FileSurfer.Core.Models.Result.Errors
get

Collection of error messages describing why the operation failed.

Empty if the operation succeeded.

Implements FileSurfer.Core.Models.IResult.

◆ IsOk

bool FileSurfer.Core.Models.Result.IsOk
get

Value indicating whether the operation was successful.

Implements FileSurfer.Core.Models.IResult.


The documentation for this class was generated from the following file:
  • /home/janecea/Documents/CODE/PROJECTS/FileSurfer/src/FileSurfer.Core/Models/IResult.cs