Class Result<T>
- Namespace
- Huddly.Sdk.Models
- Assembly
- Huddly.Sdk.dll
public sealed class Result<T>
Type Parameters
T
- Inheritance
-
Result<T>
- Inherited Members
-
Constructors
Result(StatusCode, Exception)
public Result(StatusCode statusCode, Exception error)
Parameters
statusCode
StatusCode
error
Exception
Result(StatusCode, T)
public Result(StatusCode statusCode, T value)
Parameters
statusCode
StatusCode
value
T
Properties
Error
public Exception? Error { get; init; }
Property Value
- Exception
IsSuccess
public bool IsSuccess { get; }
Property Value
- bool
Message
public string Message { get; }
Property Value
- string
StatusCode
public StatusCode StatusCode { get; init; }
Property Value
- StatusCode
Value
public T? Value { get; init; }
Property Value
- T
Methods
GetValueOrThrow()
public T GetValueOrThrow()
Returns
- T
InternalError(Exception)
public static Result<T> InternalError(Exception ex)
Parameters
ex
Exception
Returns
- Result<T>
InternalError(string)
public static Result<T> InternalError(string errorMessage)
Parameters
errorMessage
string
Returns
- Result<T>
LogIfError(ILogger, string?, params object?[])
public void LogIfError(ILogger logger, string? message, params object?[] args)
Parameters
logger
ILogger
message
string
args
object[]
NotSupported(Exception)
public static Result<T> NotSupported(Exception ex)
Parameters
ex
Exception
Returns
- Result<T>
NotSupported(string)
public static Result<T> NotSupported(string errorMessage)
Parameters
errorMessage
string
Returns
- Result<T>
PermissionDenied(Exception)
public static Result<T> PermissionDenied(Exception ex)
Parameters
ex
Exception
Returns
- Result<T>
Success(T)
public static Result<T> Success(T value)
Parameters
value
T
Returns
- Result<T>
ThrowIfError()
public void ThrowIfError()
Timeout(Exception)
public static Result<T> Timeout(Exception ex)
Parameters
ex
Exception
Returns
- Result<T>
Timeout(string)
public static Result<T> Timeout(string errorMessage)
Parameters
errorMessage
string
Returns
- Result<T>
Unavailable(Exception)
public static Result<T> Unavailable(Exception ex)
Parameters
ex
Exception
Returns
- Result<T>
Unavailable(string)
public static Result<T> Unavailable(string errorMessage)
Parameters
errorMessage
string
Returns
- Result<T>