Class ResultInfo<T, U>
Record to contain both whether the task was a success and the resulting data
Implements
IEquatable<ResultInfo<T, U>>
Inherited Members
Namespace: DevToys.Api
Assembly: DevToys.Api.dll
Syntax
public record ResultInfo<T, U> : IEquatable<ResultInfo<T, U>> where U : Enum
Type Parameters
Name | Description |
---|---|
T | Type of the result |
U | The severity of the result |
Constructors
ResultInfo(string, U)
Record to contain both whether the task was a success and the resulting data
Declaration
public ResultInfo(string errorMessage, U severity)
Parameters
Type | Name | Description |
---|---|---|
string | errorMessage | The error message |
U | severity | The severity of the result |
ResultInfo(T, string, U)
Record to contain both whether the task was a success and the resulting data
Declaration
public ResultInfo(T data, string errorMessage, U severity)
Parameters
Type | Name | Description |
---|---|---|
T | data | The resulting data or the task |
string | errorMessage | The error message |
U | severity | The severity of the result |
ResultInfo(T, U)
Record to contain both whether the task was a success and the resulting data
Declaration
public ResultInfo(T data, U severity)
Parameters
Type | Name | Description |
---|---|---|
T | data | The resulting data or the task |
U | severity | The severity of the result |
Properties
Data
The resulting data or the task
Declaration
public T? Data { get; }
Property Value
Type | Description |
---|---|
T |
ErrorMessage
Error message to display
Declaration
public string? ErrorMessage { get; }
Property Value
Type | Description |
---|---|
string |
Severity
Severity of the result
Declaration
public U Severity { get; }
Property Value
Type | Description |
---|---|
U |