Class Result
public sealed class Result
- Inheritance
-
Result
- Inherited Members
Constructors
Result(StatusCode, Exception?)
public Result(StatusCode statusCode, Exception? error = null)
Parameters
statusCodeStatusCodeerrorException
Properties
Error
public Exception? Error { get; init; }
Property Value
IsSuccess
[MemberNotNullWhen(false, "Error")]
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
exException
Returns
InternalError(string)
public static Result InternalError(string errorMessage)
Parameters
errorMessagestring
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
exException
Returns
NotSupported(string)
public static Result NotSupported(string errorMessage)
Parameters
errorMessagestring
Returns
NotSupportedDeviceApi(Manufacturer, DeviceModel, string, string?)
public static Result NotSupportedDeviceApi(Manufacturer manufacturer, DeviceModel model, string methodName, string? messageSuffix = null)
Parameters
Returns
PermissionDenied(Exception)
public static Result PermissionDenied(Exception ex)
Parameters
exException
Returns
Success()
public static Result Success()
Returns
Success<T>(T)
public static Result<T> Success<T>(T value)
Parameters
valueT
Returns
- Result<T>
Type Parameters
T
ThrowIfError()
public void ThrowIfError()
Timeout(Exception)
public static Result Timeout(Exception ex)
Parameters
exException
Returns
Timeout(string)
public static Result Timeout(string errorMessage)
Parameters
errorMessagestring
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
exException
Returns
Unavailable(string)
public static Result Unavailable(string errorMessage)
Parameters
errorMessagestring