Class ApiResult<T>
- Namespace
- Tudormobile.Strava.Api
- Assembly
- Tudormobile.Strava.dll
Strava API result. Encapsulates the result of an API call.
public class ApiResult<T>
Type Parameters
TType of the result data.
- Inheritance
-
ApiResult<T>
- Inherited Members
Remarks
This object encapsulates the data resulting from an asynchronous call to the Strava API. If no errors occur, the Data property will contain the result data. If an error occurs, the Error property will contain and ApiError object that describes the error. The Success property indicates whether the call was successful.
Constructors
ApiResult(T?, ApiError?)
Create an initialize a new instance.
public ApiResult(T? data = default, ApiError? error = null)
Parameters
dataT(Optional) The Data to include. If omitted, (null) is used.
errorApiError(Optional) The Error to include. If omitted, (null) is used.
Properties
Data
Returned data, if successful; otherwise (null).
public T? Data { get; init; }
Property Value
- T
Error
Error information or (null) if no errors.
public ApiError? Error { get; init; }
Property Value
Success
True if data is valid.
public bool Success { get; }