Table of Contents

Interface ITimetableClient

Namespace
DotBahn.Timetables
Assembly
DotBahn.Timetables.dll

Client for accessing the 'Deutsche Bahn Timetables'-API.

public interface ITimetableClient

Methods

GetFullChangesAsync(int, Timetable?, CancellationToken)

Gets full changes for a specific station. If a Timetable is supplied, the changes are merged onto this instance.

Task<Timetable> GetFullChangesAsync(int eva, Timetable? mergeOn = null, CancellationToken cancellation = default)

Parameters

eva int

The EVA station number.

mergeOn Timetable

Current timetable on which these changes should apply.

cancellation CancellationToken

Token to cancel the request.

Returns

Task<Timetable>

A Timetable with full change information.

Exceptions

HttpRequestException

Thrown when non-success status codes occur.

GetRecentChangesAsync(int, Timetable?, CancellationToken)

Gets recent changes for a specific station. If a Timetable is supplied, the changes are merged onto this instance.

Task<Timetable> GetRecentChangesAsync(int eva, Timetable? mergeOn = null, CancellationToken cancellation = default)

Parameters

eva int

The EVA station number.

mergeOn Timetable

Current timetable on which these changes should apply.

cancellation CancellationToken

Token to cancel the request.

Returns

Task<Timetable>

A Timetable with recent change information.

Exceptions

HttpRequestException

Thrown when non-success status codes occur.

GetTimetableAsync(int, DateTime, CancellationToken)

Gets the timetable for a specific station and time.

Task<Timetable> GetTimetableAsync(int eva, DateTime dateTime, CancellationToken cancellation = default)

Parameters

eva int

The EVA station number.

dateTime DateTime

The date and hour (only YYMMDD/HH are used).

cancellation CancellationToken

Token to cancel the request.

Returns

Task<Timetable>

A Timetable for the specified hour.

Exceptions

HttpRequestException

Thrown when non-success status codes occur.