Skip to content

TempService

Namespace: Rest_API.Services.Temp

Provides operations related to the location for the outside temperature data, for example getting the right coordinates for the postalcode.

public class TempService : ITempService

Inheritance ObjectTempService

Implements ITempService

Constructors

TempService(ILogger<TempService>, IHttpClientFactory, ICoordinateRepo, IConfiguration)

Initializes a new instance of the TempService class.

public TempService(ILogger<TempService> logger, IHttpClientFactory httpClientFactory, ICoordinateRepo coordinateRepo, IConfiguration configuration)

Parameters

logger ILogger<TempService>

The logger instance for logging actions and errors.

httpClientFactory IHttpClientFactory

The httpClient for API calls.

coordinateRepo ICoordinateRepo

The settingsRepo instance for connection with the postgres database.

configuration IConfiguration

Methods

GetCoordinates(Int32)

public Task GetCoordinates(int postalCode)

Parameters

postalCode Int32

Returns

Task

ShowAvailableLocations()

public Task<List<Tuple<Int32, String>>> ShowAvailableLocations()

Returns

Task<List<Tuple<Int32, String>>>