Class FinancialDataResponse<T>
- Namespace
- Tudormobile.FinancialData
- Assembly
- Tudormobile.FinancialData.dll
Represents the response from a financial data API call.
public class FinancialDataResponse<T>
Type Parameters
TThe type of data returned by the API call.
- Inheritance
-
FinancialDataResponse<T>
- Inherited Members
Constructors
FinancialDataResponse(T?, string?)
Creates and initializes a new instance of the FinancialDataResponse<T> class with the specified data and error message.
public FinancialDataResponse(T? data = default, string? error = null)
Parameters
dataTThe data associated with the response, or null if no data is available.
errorstringThe error message associated with the current instance, if any.
Properties
Data
Gets the data associated with the response, or null if no data is available.
public T? Data { get; }
Property Value
- T
Error
Gets the error message associated with the current instance, if any.
public string? Error { get; }
Property Value
Remarks
This property returns a string that provides details about the error that occurred. It will be null if no error has been recorded.
IsSuccess
Gets a value indicating whether the operation completed successfully.
public bool IsSuccess { get; }
Property Value
Remarks
The property returns true if the response contains data; otherwise, it returns false. Use this property to determine whether the operation produced a valid result before accessing the data.
Methods
PremiumSubscriptionNotImplemented()
Returns a task that represents an asynchronous operation indicating that the premium subscription API is not implemented.
public static Task<FinancialDataResponse<T>> PremiumSubscriptionNotImplemented()
Returns
- Task<FinancialDataResponse<T>>
A task containing a FinancialDataResponse<T> object with an error message stating that the premium subscription API is not implemented.
StandardSubscriptionNotImplemented()
Returns a task that represents the asynchronous operation of retrieving financial data, indicating that the standard subscription API is not implemented.
public static Task<FinancialDataResponse<T>> StandardSubscriptionNotImplemented()
Returns
- Task<FinancialDataResponse<T>>
A task containing a FinancialDataResponse<T> object with an error message stating that the standard subscription API is not implemented.