Table of Contents

Interface IWebServerInvoker

Namespace
Geotab.Checkmate.Web
Assembly
Geotab.Checkmate.ObjectModel.dll

An interface for communicating with a web service or API.

public interface IWebServerInvoker

Methods

InvokeAsync<T>(string, object?, CancellationToken)

Asynchronously invoke a call to the specified method.

Task<T?> InvokeAsync<T>(string method, object? parameters = null, CancellationToken cancellationToken = default)

Parameters

method string

Method to invoke.

parameters object

An anonymous object used as the parameters to pass into the method with corresponding parameter values, for instance: new {username = "ivant@gmail.com", password = "123"}.

cancellationToken CancellationToken

The CancellationToken used to signal that the request should be cancelled.

Returns

Task<T>

Result of the invoke operation converted to the return Type if provided.

Type Parameters

T

The object type to deserialize to and return.

InvokeAsync<T>(string, string?, object?, CancellationToken)

Asynchronously invoke a call to the specified method.

Task<T?> InvokeAsync<T>(string method, string? traceId, object? parameters = null, CancellationToken cancellationToken = default)

Parameters

method string

Method to invoke.

traceId string

traceId of httpcontext

parameters object

An anonymous object used as the parameters to pass into the method with corresponding parameter values, for instance: new {username = "ivant@gmail.com", password = "123"}.

cancellationToken CancellationToken

The CancellationToken used to signal that the request should be cancelled.

Returns

Task<T>

Result of the invoke operation converted to the return Type if provided.

Type Parameters

T

The object type to deserialize to and return.