Table of Contents

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

T

Type 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

data T

(Optional) The Data to include. If omitted, (null) is used.

error ApiError

(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

ApiError

Success

True if data is valid.

public bool Success { get; }

Property Value

bool