A flexible implementation of IResult that supports multiple error messages and can be updated after creation.
More...
|
| 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 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.
|
|
| bool | IsOk [get] |
| | Value indicating whether the operation was successful.
|
| IEnumerable< string > | Errors [get] |
| | Collection of error messages describing why the operation failed.
|
A flexible implementation of IResult that supports multiple error messages and can be updated after creation.
◆ AddError()
| void FileSurfer.Core.Models.Result.AddError |
( |
string | errorMessage | ) |
|
|
inline |
Appends an error message to this result.
- Parameters
-
| errorMessage | Error 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
-
| errors | Collection 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
-
| result | Source 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
-
| errorMessage | Error message describing the failure. |
- Returns
- Failed Result containing the provided error.
◆ MergeResult()
| Result FileSurfer.Core.Models.Result.MergeResult |
( |
IResult | result | ) |
|
|
inline |
Appends all errors from another result to this result.
- Parameters
-
| result | Result whose errors should be merged into this instance. |
- Returns
- This Result instance after merging.
◆ Ok()
| Result FileSurfer.Core.Models.Result.Ok |
( |
| ) |
|
|
inlinestatic |
Creates a successful result with no errors.
- Returns
- Successful Result instance.
◆ Errors
| IEnumerable<string> FileSurfer.Core.Models.Result.Errors |
|
get |
◆ IsOk
| bool FileSurfer.Core.Models.Result.IsOk |
|
get |
The documentation for this class was generated from the following file:
- /home/janecea/Documents/CODE/PROJECTS/FileSurfer/src/FileSurfer.Core/Models/IResult.cs