Table of Contents

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

T

The 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

string

IsSuccess

Gets a value indicating whether the API call was successful.

public bool IsSuccess { get; }

Property Value

bool

Methods

Failure(string)

Creates a failed response containing the given error message.

public static IronLedgerResponse<T> Failure(string errorMessage)

Parameters

errorMessage string

The error message describing the failure.

Returns

IronLedgerResponse<T>

Success(T)

Creates a successful response containing the given data.

public static IronLedgerResponse<T> Success(T data)

Parameters

data T

The data returned by the API call.

Returns

IronLedgerResponse<T>