Class Result
public sealed class Result
- Inheritance
-
Result
- Inherited Members
Constructors
Result(StatusCode, Exception?)
public Result(StatusCode statusCode, Exception? error = null)
Parameters
statusCode
StatusCodeerror
Exception
Properties
Error
public Exception? Error { get; init; }
Property Value
IsSuccess
public bool IsSuccess { get; }
Property Value
Message
public string Message { get; }
Property Value
StatusCode
public StatusCode StatusCode { get; init; }
Property Value
Methods
InternalError(Exception)
public static Result InternalError(Exception ex)
Parameters
ex
Exception
Returns
InternalError(string)
public static Result InternalError(string errorMessage)
Parameters
errorMessage
string
Returns
LogIfError(ILogger, string?, params object?[])
public void LogIfError(ILogger logger, string? message, params object?[] args)
Parameters
NotSupported(Exception)
public static Result NotSupported(Exception ex)
Parameters
ex
Exception
Returns
NotSupported(string)
public static Result NotSupported(string errorMessage)
Parameters
errorMessage
string
Returns
PermissionDenied(Exception)
public static Result PermissionDenied(Exception ex)
Parameters
ex
Exception
Returns
Success()
public static Result Success()
Returns
Success<T>(T)
public static Result<T> Success<T>(T value)
Parameters
value
T
Returns
- Result<T>
Type Parameters
T
ThrowIfError()
public void ThrowIfError()
Timeout(Exception)
public static Result Timeout(Exception ex)
Parameters
ex
Exception
Returns
Timeout(string)
public static Result Timeout(string errorMessage)
Parameters
errorMessage
string
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Unavailable(Exception)
public static Result Unavailable(Exception ex)
Parameters
ex
Exception
Returns
Unavailable(string)
public static Result Unavailable(string errorMessage)
Parameters
errorMessage
string