Class IronLedgerResponse<T>
- Namespace
- Tudormobile.IronLedgerLib.Services
- Assembly
- Tudormobile.IronLedgerLib.Services.dll
Represents the result of an IronLedger API call. Use IsSuccess to distinguish success.
public sealed class IronLedgerResponse<T>
Type Parameters
TThe type of data returned on success.
- Inheritance
-
IronLedgerResponse<T>
- Inherited Members
Properties
Data
Gets the data returned by the API call, or null on failure.
public T? Data { get; }
Property Value
- T
Remarks
Can be null on success when no data is returned.
ErrorMessage
Gets the error message associated with a failed API call, or null on success.
public string? ErrorMessage { get; }
Property Value
IsSuccess
Gets a value indicating whether the API call was successful.
public bool IsSuccess { get; }
Property Value
Methods
Failure(string)
Creates a failed response containing the given error message.
public static IronLedgerResponse<T> Failure(string errorMessage)
Parameters
errorMessagestringThe error message describing the failure.
Returns
Success(T)
Creates a successful response containing the given data.
public static IronLedgerResponse<T> Success(T data)
Parameters
dataTThe data returned by the API call.